Hi

I’m trying to rotate a 3D wire cone and to find the coordinates of the tip once rotation has been applied. Is there any function to do this automatically?

Thanks in advance!

Hi

I’m trying to rotate a 3D wire cone and to find the coordinates of the tip once rotation has been applied. Is there any function to do this automatically?

Thanks in advance!

apologies, i meant that rotation has been applied and i want to be able to track the coordinates of the tip of the cone if thats possible?

If you’re using the modelview matrix provided by OpenGL, you should query that and then multiply the matrix by the initial coordinates of the tip of the cone. I don’t think there’s a function to do this automatically, but it’s not particularly difficult.

sorry i’m really new to this, heres a section my code:

glClear(GL_COLOR_BUFFER_BIT);

glPushMatrix();

```
glTranslatef(0.0, 0.0, 0.0);
glRotatef(0.0, 0.0, 0.0, 0.0);
glPushMatrix();
glutWireCube(1.0);
glPopMatrix();
glTranslatef(0.0, 1.0, 0.0);
glRotatef((GLfloat) segment[5], 0.0, 0.0, 1.0);
glPushMatrix();
glutWireSphere(0.5, 10, 10);
glPopMatrix();
glGetFloatv(GL_MODELVIEW_MATRIX, currentPos[6]);
```

it is my understanding that glGetFloatv(GL_MODEL_MATRIX, matrix) saves the current coordinates to matrix[12], matrix[13], and matrix[14]. is this not so? if it is not, how do i get the coordinates from the modelview matrix?