Search found 873 matches
- Thu Nov 30, 2017 3:27 pm
- Forum: Support and Development
- Topic: [solved] Unpredictable error triangulating a polygon
- Replies: 3
- Views: 7078
Re: Unpredictable error triangulating a polygon
From love.math.triangulate : Decomposes a simple convex or concave polygon into triangles. [...] table polygon Polygon to triangulate. Must not intersect itself. A simple polygon is one that does not intersect itself and has no holes. I don't know what algorithm triangulate uses Kong's triangulation...
- Sat Nov 04, 2017 11:36 am
- Forum: Support and Development
- Topic: Shader questions
- Replies: 2
- Views: 7766
Re: Shader questions
-> How can I get the color of a given pixel in a texture sent to the shader? Suppose I send a drawn canvas to the shader. How can I get the color of a certain pixel on this canvas? As grump wrote, the Texel() function does what you want, but keep in mind that shaders work "inside out": Th...
- Sat Nov 04, 2017 11:26 am
- Forum: Support and Development
- Topic: Delete an object
- Replies: 3
- Views: 12515
Re: Delete an object
From the PIL, chapter 17 : Lua does automatic memory management. A program only creates objects (tables, functions, etc.); there is no function to delete objects . Lua automatically deletes objects that become garbage, using garbage collection. You need to remove all references to the object, that m...
- Sat Nov 04, 2017 10:42 am
- Forum: Support and Development
- Topic: TextBox in LOVE2d?
- Replies: 4
- Views: 11376
Re: TextBox in LOVE2d?
Shameless plug: Here is how to do it with SUIT . The important part is in the validate function, which uses string.gsub() to remove unwanted characters. You can do anything you like here. local suit = require 'suit' local utf8 = require 'utf8' local function validate(input) local len = utf8.len(inpu...
- Tue Oct 31, 2017 5:55 pm
- Forum: Libraries and Tools
- Topic: [library] moonshine – Chainable post-processing shaders for LÖVE.
- Replies: 12
- Views: 32312
Re: [library] moonshine – Chainable post-processing shaders for LÖVE.
I am unsure what you mean by that, but the shaders apply to everything drawn inside the effect.draw(...) call.
- Tue Oct 31, 2017 5:50 pm
- Forum: Games and Creations
- Topic: Genetic neural network plays FlappyBird
- Replies: 3
- Views: 7848
Re: Genetic neural network plays FlappyBird
Fun project that leaves room for so much experimentation. Here are a few suggestions: For the neural net: Use different activation function, for example ReLU, leaky ReLU, sinc, etc. ( here is a list ). How do the different activation functions affect how fast the computer learns to play the game? Us...
- Tue Oct 31, 2017 3:41 pm
- Forum: Libraries and Tools
- Topic: [library] moonshine – Chainable post-processing shaders for LÖVE.
- Replies: 12
- Views: 32312
[library] moonshine – Chainable post-processing shaders for LÖVE.
TL;DR: shine version 2.0: Better API, better performance, better name. Less than 10 lines of code to transform this: noonshine.jpg into this: moonshine.jpg Lövers, ever since shaders were first added to LÖVE , I had this idea of a vast repository of common post-processing shaders that you could jus...
- Sat Oct 28, 2017 8:56 am
- Forum: Support and Development
- Topic: math.random > love.math.random
- Replies: 10
- Views: 16614
Re: math.random > love.math.random
I was curious, so I did my own test. I also computed the variation in run time to get a sense if the difference is (statistically) significant. This is the code I used: -- compute mean and standard deviation from sample local function mean_std(t) assert(#t >= 2) local mean, scatter = 0, 0 for n,x in...
- Thu Jul 14, 2016 11:38 am
- Forum: General
- Topic: Need some help with learning Lua
- Replies: 6
- Views: 9247
Re: Need some help with learning Lua
The PIL teaches you everything there is to know about Lua and is (in my opinion) one of the best books about programming languages in general. It's a bit dense, but given that you already know other programming languages that should be no problem.
- Thu Jul 14, 2016 11:34 am
- Forum: General
- Topic: Finding neighbours on an arbitrary polygon grid
- Replies: 6
- Views: 8876
Re: Finding neighbours on an arbitrary polygon grid
I'm afraid you will have to check every polygon. However, you can speed up the intersection tests by computing the outcircle of each polygon (has to be done only once) and test whether the outcircles intersect (centroid-distance < sum-of-radii). If they don't, you know the polygons will not share a ...