Pages

Friday, February 26, 2021

Voxel maths corrections, part 2

 

Two bunnies, one polygonal, one voxel.
Which bunny is rendered with Voxels? If you answered "the one that's not Z-sorted properly" then you are correct! It may not look like much, but now the voxels use the same matrices for positioning as the rest of my code. Well, the projection isn't the same, but it's a very close (and very dirty) approximation. The modelview matrices are however the same. So finally the normals, the projection, the positioning, are identical. And back to tradition, here is the code.

Wednesday, February 24, 2021

Symmetry and Maths

If you scroll back through the older posts, you may notice that the bunny is facing a different direction between regular OpenGL and the voxel view. I only just noticed it today, while trying to get the voxel view to align up with my newer 3d maths code. As you can see, the scale and position aren't exactly correct, but at least now they're close, and I'm not mirroring the bunny through any axis. Really not sure how I never noticed that one, but you live and learn.