Archived

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

supagu

culling issues.... transform frustrum points

Recommended Posts

supagu    148
okay im using OGL and my own matrix class.... what i do is extract the 8 points from the frustum, and i want to transform them to worls space.... this is what i do:
	//set world matrix also

	glLoadIdentity();
	LookAt();
	//glTranslatef( position[X], position[Y], position[Z] );

	world.LoadCurrent();
	world = world * projection;

	//Matrix4 rot;

	//rot.RotateY( DtoR(-45) );

	//world = world * rot;

	world.Transpose();


and transform like this:
   
BOUNDS Camera::GetTransformedBounds()
{
	BOUNDS worldBounds;
	
	for( int i = 0 ; i < 8; ++i )
	{
		worldBounds.points[i] = world * frustum.points[i];
	}

	return worldBounds;
}
seems as if the transformation is only working with rotations, leaving the positions/transform out of the multiplication some how :-/ ie. seems as if my frustrum for culling is always situated at 0,0,0 any ideas if this is the troublesome code? [edited by - supagu on March 20, 2004 11:41:34 PM]

Share this post


Link to post
Share on other sites