Ehsan Kamrani

11-24-2005, 11:21 PM

Hi

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 binding box and check that if i'm inside this binding box. But now i don't know that how i should use from my posConvertor function to check the boundries of my binding box. Any suggestion?

-Ehsan-

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 binding box and check that if i'm inside this binding box. But now i don't know that how i should use from my posConvertor function to check the boundries of my binding box. Any suggestion?

-Ehsan-