I would like to make a static 2d world compromised of just some borders. I will add in a cube and have it so you can move the cube around but not outside the borders (simple collision detection). The simple idea is pictured below:
My questions are:
- To make the barriers, is that just a collection of vertexes put in the game world?
- I have some books on collision detection to get stuck into, but is the simple gist: if the world space location of a cubes vertex and the barriers vertex overlap... do not move?
- I am a bit stuck on how to make the world periodic (if the cube goes through the top it comes out up through the bottom). Any suggestions or resources on this would be great. (eg. I wonder how you render if half of the cube is top and half is comming up from the bottom).
One last slightly random question. I am still very new to this so it may seem odd, but is there a "vertex generator" where I can draw a simple model and it will spit out the object space vertices required to make this. Eg If I specify 3 vertices to mimic a triangle I have drawn it spits out something like:
Vertex(0.0f, 0.5f, 0.5f), Vertex(0.5f, -0.5f, 0.5f), Vertex(-0.5f, -0.5f, 0.5f)
Edited by SteveHatcher, 05 December 2013 - 05:19 AM.