Ehsan Kamrani

11-25-2005, 02:57 AM

I have used from the following transformations to move my environment:

glRotatef( 360 - yrot, 0,1,0 );

glTranslatef( -xpos, -walkbias - 6.0f + beeHeight, -zpos );

In my environment, i have some points that should check their positions. So i have written a function to simulate the above OpenGL transformations:

void PosConvertor(float x, float y, float z)

{

xx=(float)cos(( 360.0 - yrot )* piover180 ) * ( x-xpos) + (float)sin(( 360.0 - yrot )* piover180 )*(z -zpos );

yy=y- walkbias - 2;

zz=-(float)sin( ( 360.0 - yrot )* piover180 )* (x -xpos ) + (float)cos( ( 360.0 - yrot )* piover180 ) * ( z -zpos );

}

The function posConvertor is like the OpenGL transformations that i have used in my code. I can check the position of my objects with the function posConvertor. But now i want to create a bounding box and check that if i'm inside this bounding box. But now i don't know that how i should use from my posConvertor function to check the boundries of my bounding box. Any suggestion?

-Ehsan-

glRotatef( 360 - yrot, 0,1,0 );

glTranslatef( -xpos, -walkbias - 6.0f + beeHeight, -zpos );

In my environment, i have some points that should check their positions. So i have written a function to simulate the above OpenGL transformations:

void PosConvertor(float x, float y, float z)

{

xx=(float)cos(( 360.0 - yrot )* piover180 ) * ( x-xpos) + (float)sin(( 360.0 - yrot )* piover180 )*(z -zpos );

yy=y- walkbias - 2;

zz=-(float)sin( ( 360.0 - yrot )* piover180 )* (x -xpos ) + (float)cos( ( 360.0 - yrot )* piover180 ) * ( z -zpos );

}

The function posConvertor is like the OpenGL transformations that i have used in my code. I can check the position of my objects with the function posConvertor. But now i want to create a bounding box and check that if i'm inside this bounding box. But now i don't know that how i should use from my posConvertor function to check the boundries of my bounding box. Any suggestion?

-Ehsan-