# Rotate x and z around 1 point

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

## Recommended Posts

Hello, It eludes me. I want the arrow keys left and right rotate around 1 point(x,z). I can't find it after a lot of searching. What's wrong with the code (otherwise working fine) ------------------------------------------------------------------------------ typedef struct Vector { double x,y,z; }Vector; Vector V1; Vector V2; Vector orientation; /* Point 3D */ typedef struct Point { double x,y,z; }Point; Point eye; Point point; void Vecteur_pVect(SVecteur *V1, SVecteur *V2, SVecteur *V3) { V3->x=V1->y*V2->z-V1->z*V2->y; V3->y=V1->z*V2->x-V1->x*V2->z; V3->z=V1->x*V2->y-V1->y*V2->x; } --------------------------------------------------------------------- eye.x = 0.0f; eye.y = 0.0f; eye.z = 130.0f; point.x = 0.0f; point.y = 0.0f; point.z = 0.0f; V1.x = 1.0f; V1.y = 0.0f; V1.z = 0.0f; V2.x = point.x-eye.x; V2.y = point.y-eye.y; V2.z = point.z-eye.z; Vecteur_pVect(&V1,&V2,&orientation); gluLookAt(eye.x,eye.y,eye.z, point.x,point.y,point.z, orientation.x,orientation.y,orientation.z); glTranslated(param.transrl,param.transyy,param.transud); glRotated(hoek,1.0,0.0,0.0); glRotated(charleft,0.0,1.0,0.0); //arrowkeys = charleft = left and right around 1 point == not working glTranslated(0.0, 0.0, 0.0); ------------------------------------------------------------------------------ Thanks a lot, Renran

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633702
• Total Posts
3013451
×