Archived

This topic is now archived and is closed to further replies.

Strange Cg/GL Transformation Problem

This topic is 4956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I'm doing Cg fragment lighting in OpenGL. When I use the fixed functionality pipeline, I do this and get correct output.
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
	glTranslatef(0, 0, -5.0f);
	glRotatef(theta, 0.25f, 0.634f, 0.26f);
	glGetFloatv(GL_MODELVIEW_MATRIX, modelView);
	cgGLSetMatrixParameterfc(modelViewProj, modelView);
	glutSolidTeapot(2.0f);
glPopMatrix();
glutSwapBuffers();
As you can see I pass in the current Modelview matrix as a column-major matrix. But when I enable the appropriate profile, and bind my programs, It seems as though the translation did not occur at all; the camera is inside the teapot. The rotation may or may not be happening. Here's the relevant Cg code:
uniform float4x4 modelViewProj
...
oPosition = mul(modelViewProj, position);
Any clues? Thanks, TT [edited by - TThirion on May 20, 2004 5:59:53 PM]

Share this post


Link to post
Share on other sites