groovemaster
08-09-2006, 05:14 AM
Hi all,
I'm currently learning the basics of GLSL, following the lighthouse3d tutorials. One of the very first shaders presented is a flatten (vertex) shader, where every incoming vertex's z value is set to 0.0 before transforming it. Like this:
void main()
{
vec4 v = vec4(gl_Vertex);
v.z = 0.0;
gl_Position = gl_ModelViewProjectionMatrix * v;
}The result ought to be obejects that are projected on the xy-plane. This works when I draw a quad, or a glutSolidSphere. However, when I a draw a glutSolidTeapot, somehow that one is flattened
in the y-direction, or projected on the xz-plane.
The source I downloaded from lighthouse3d had the same effect so its not some side effect from my code I think. Any toughts on this one? I'm very curious to why the teapot behaves differently.
Thanks for reading,
groovemaster
I'm currently learning the basics of GLSL, following the lighthouse3d tutorials. One of the very first shaders presented is a flatten (vertex) shader, where every incoming vertex's z value is set to 0.0 before transforming it. Like this:
void main()
{
vec4 v = vec4(gl_Vertex);
v.z = 0.0;
gl_Position = gl_ModelViewProjectionMatrix * v;
}The result ought to be obejects that are projected on the xy-plane. This works when I draw a quad, or a glutSolidSphere. However, when I a draw a glutSolidTeapot, somehow that one is flattened
in the y-direction, or projected on the xz-plane.
The source I downloaded from lighthouse3d had the same effect so its not some side effect from my code I think. Any toughts on this one? I'm very curious to why the teapot behaves differently.
Thanks for reading,
groovemaster