So I’m making a voxel engine with lwjgl. Every entity is composed of a bunch of voxels. I’m wondering which of the following two methods is more efficient for moving around/rotating an entity (Or if there’s a better method.)
Method 1: An entity has x, y, and z variables that I can change to move it around. These variables will be used for the offset of every voxel that the entity is composed of. The render function calculates where every quad of every voxel will be based on the x, y, and z variables of the entity. Upside: I can move the entire entity around by simply changing the x, y, and z variables. Downside: Many, many quad positions will have to be calculated every single render function!
Method 2: All the voxel quads of an entity are loaded into a display list when the game starts. I can move the entity around using glPushMatrix(), glTranslatef(), and glPopMatrix(). Upside: This means that the program doesn’t have to do all those calculations every frame. Downside the voxel positions in the display list are fixed, so I can only move the entity around by pushing and popping the matrix. I heard that having to do this for every entity is a bad Idea.
I’m not even sure If everything I said is true, so correct me if I said something wrong, and I’ll edit the post. 3D is a lot more confusing than 2D! Anyways, which method is more efficient? Are there other methods that might work better? Thanks!