Hey that’s the current state of the engine.
SIGCNIGiL4M
[s]Hello there, I just started the development of a voxel engine. I seperated the world to 100 chunks, each one containes 16x16x16 dirt blocks. So, I used the distance formula in order to draw only the chunks which are max 32 blocks away from me.
The problem is that when I am starting to go away from the chunks the first chunks that dissappear are the ones which are closer to me, when the opposite was supposed to happend. The whole idea doesn’t seem to work good. Can you see what’s wrong or can you recommend any other way (with an example) about how to draw only the closest chunks in a x radious?
The distance formula I used:[/s]
(float)Math.sqrt(Math.pow(camera.position.x - chunk.centerX,2) + Math.pow(camera.position.y - chunk.centerY,2) + Math.pow(camera.position.z - chunk.centerZ,2)) < 32*Block.width
Where Block.width = 0.7f;
wbVG8tneqoY
Thank you.