Improved CTestSceneNode (texture mapping/lightning)
Posted: Wed May 12, 2004 9:43 pm
In my opinion CTestSceneNode has two bugs. One in the texture mapping and one in the lightning.
This is a TestSceneNode with some texture and a light shining on it:
Ugly, isn't it?
The texture mapping looks like this:
It's destorted on most sides. Well, this is already an improvement by Dr Bragianos.
Before it looked like this (commented out in the source):
Here 4 sides are not distorted, but 2 are extremly distorted.
The distortion is less noticeable in the first version, but it's still a compromise.
I think it should look like this:
Some sides are still mirrored. But it doesn't matter if there is not text on the texture.
To achieve this I added just 4 vertices with proper uv coords to the existing 8 and reordered the triangles (which are still 12).
This fixed the texture mapping.
The lightning looks like this:
It's ugly because the normal vectors of the vertices are all messed up.
I fixed them so it looks like this:
And if you put it all together then it could look as beautyful as this:
I think now it has deserved the title CubeSceneNode
I'll post the source in a minute...
This is a TestSceneNode with some texture and a light shining on it:
Ugly, isn't it?
The texture mapping looks like this:
It's destorted on most sides. Well, this is already an improvement by Dr Bragianos.
Before it looked like this (commented out in the source):
Here 4 sides are not distorted, but 2 are extremly distorted.
The distortion is less noticeable in the first version, but it's still a compromise.
I think it should look like this:
Some sides are still mirrored. But it doesn't matter if there is not text on the texture.
To achieve this I added just 4 vertices with proper uv coords to the existing 8 and reordered the triangles (which are still 12).
This fixed the texture mapping.
The lightning looks like this:
It's ugly because the normal vectors of the vertices are all messed up.
I fixed them so it looks like this:
And if you put it all together then it could look as beautyful as this:
I think now it has deserved the title CubeSceneNode
I'll post the source in a minute...