I’m creating a mesh like
function init(self)
self.control_points = { {-0.5, 1}, {-0.25, 0.5}, {-0.5, -1}, {0.25, 0.5} }
regenerate_mesh(self)
end
my mesh generation works fine and creates concave/convex shapes using triangulation.
I want to be able to draw a game object with a sprite and collision object (via a factory in a separate object) i’ve tested drawing the control_point object via posting messages to the spawner which holds the factory
local pos = go.get_position()
msg.post(“spawner#spawner”, “create_control_point”, {x = pos.x+30, y = pos.y+30})
where the spawner just listens to that message and does factory.create() - however what I want to be able to do is send x,y coordinates that map onto where the vertices are for my control_points that i used to create the shape. they’re all between 0-1 but I’ve got no idea what units this represents or how to convert between them and world space, or if you even can. This could have some solution with the vertex program? but im not sure if im way off with that idea.
I could work out the mathematics of this if I knew what 0-1 vertex position actually means numerically. 1 what?