Hi,
I'd like to adapt this to create a "standard" sphere, where the face normals point outward instead of inward like this skybox sphere.
I tried flipping the vertex normals in the line:
Code: Select all
Vector3 vNormal = Vector3(-x0, -y0, -z0).normalisedCopy();
to:
Code: Select all
Vector3 vNormal = Vector3(x0, y0, z0).normalisedCopy();
But there was no apparent change.
I also have some questions about this code. Unmodified, the first time through the loop, the normals are 0,-1,0 for all 16 segments on the first ring.
Are you sure that the loop condition:
Code: Select all
for( int ring = 0; ring <= Def->mRings; ring++ )
is right? Cause the last time through the loop, the x and z values for the last 16 segments appear to be invalid.
Despite this, the sphere does seem to look alright. Now, if I could only get those faces flipped...