megatronx
I didn't found the page about Rojo talking about it, was he talking about cubes or triangles? (the triangles one I found, but I was hoping to find the one talking about the cube already made by him...)
Also, have you done raycasting in you project? Or won't it have it?
Hi, I will be doing raycasting at some point. I will share it with you once done, but that's still some time away. Right now I'm still designing level building system.
As for the box, simplest way i think is to create a sprite 10x10px, set 4 origin points and then at start of the level use them when creating vertexes. You will need to create a plane 6 times and each plane is 2 triangles, so 6 verts in total per plane. The UV order for each plane is 00 01 11 11 10 00. Example of creating a plane for side using image point sprites:
ip1 ip2 This is how the sprites imagepoints are set
ip4 ip3
And this is creating a plane for wall using imagepoint1 and imagepoint2
-create vert at X ImagepointX(1) Y ImagepointY(1) Z 0 UV 00
-create vert at X ImagepointX(2) Y ImagepointY(2) Z 0 UV 01
-create vert at X ImagepointX(2) Y ImagepointY(2) Z 10 UV 11
-create vert at X ImagepointX(2) Y ImagepointY(2) Z 10 UV 11
-create vert at X ImagepointX(1) Y ImagepointY(1) Z 10 UV 10
-create vert at X ImagepointX(1) Y ImagepointY(1) Z 0 UV 00
Without imagepoints you create plane just like this
-create vert at X -1 Y -1 Z 0 UV 00
-create vert at X -1 Y 1 Z 0 UV 01
-create vert at X 1 Y 1 Z 1 UV 11
-create vert at X 1 Y 1 Z 1 UV 11
-create vert at X 1 Y -1 Z 1 UV 10
-create vert at X -1 Y -1 Z 0 UV 00
Then you'd need to scale it. Doing it this way will create origin point in the center of the plane.
When you will be creating plane for top and bottom of the cube, you have to use all 4 image points and keep Z at 0, but wij sides you need to use only 2 image points and instead increase Z by a number. The order of vert creation can change, but the first and last, as well 2 middle ones must be in the same point. You can experiment.
Once you create all planes, use save verts as mesh. Call the mesh and then create object and use that mesh. If you want different textures on each side, you got to have a texture with those sides and then set UV in such way that it is drawing only those tiles of the texture.