Using Normals for backface-culling...

Blitz3D Forums/Blitz3D Programming/Using Normals for backface-culling...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yeah, I took a closer look at your cube code.
That´s exactly what I am looking for.
Bacface culling based on the rotated normals!
I just have to try it with the sphere now, to make sure it will work for all 144 possible angles.
If it works, then that´s how I am going to do it.

Just a few more words on why this code is so crytical to the voxel engine...

1. Take the terminal bone of the pointing finger.
Every time I draw it, I have to apply its own x, y and z rotations to it, right?
But, before that, I have to apply its parents rotations to it.
And, before that, I have to apply its parents´parent´s rotations to it.
And this goes recursively, untill I reach the topmost object (in this case, the "butt").
So, after all the recursive path is taken, I end up applying 11 rotations to that small part of the model.
The part immediately above it, needs 10 rotations, and the one above it, 9 rotations, etc...
That´s why I end up with 345 rotations for each character per each frame.
(Actualy, it´s 115 rotations, but I am considering the rotation of each independent component of the normal here, i.e., 3 components per normal = 345 rotations).

So, all that I actualy need, is ONE single polygon model, which has to be a sphere.
This same sphere, with radius = 1.00, will be used to generate all normal rotations, and will be used to rebuild each normals table.

This is important to understand... rotations to normals won´t be applied to the character or any of its components.
They will be applied to the same sphere, every time.
This will allow for some level of optimization.

Thanks again,

Rui Barbosa Jr.