Help with choppy scenes

Blitz3D Forums/Blitz3D Beginners Area/Help with choppy scenes

You should read up on this: http://www.blitzbasic.com/b3ddocs/command.php?name=CreateSurface&ref=3d_cat

In Blitz an object has a surface(can be more than one, but always one) Surfaces kill framerate, so you should always use them sparingly. The number of triangles rendered is also very important to the framerate, so don't render triangles if they are invisible(ie will never be seen).

The surface consists of vertices(invisible points in 3D), like every corner of the cubes you have chosen to build with.

To the vertices, you attach triangles(each corner of the triangle attaches to a vertex), so for a cube, you would have 2 triangles for each side.

In the map image that you have posted, it looks like there is around 1000 cubes, this means 1000 surfaces and lots of triangles which are never seen, but still rendered.

You will find that one object with few surfaces with a number of vertices(verts) and triangles(tris) will render faster than the 1000 objects you are now trying to render.

I assume that you are basing the 3D on a 2D image in memory. If this is the case, then you are looking at an individual pixel and then decide to create a cube for that point. In stead, you could create 4 functions, each adding 4 vertices to the maze object(addvertex) and then 2 triangles(addtriangle) based on the square the side will be facing. If there is an empty square then you sdd the verts and triangles, but it there is an other occupied square, then you don't need to add any triangles because then the side will never be seen.


Andy