# OpenGL manually coordinate transformation

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

## Recommended Posts

(Sorry for my english ...) Hi, This is my first post in this forum, nice to met you. I´m having some problem with matrix transformation. I need to draw one point with matrix rotation and translation, after this I would like to draw another point in exactly the same place but with no Gl matrix rotation or translation. So I think I need to load GlModelview matrix (with rotation or translation) and multiplication it with my point coordinates ... I´m trying but with no success This is my code: PushMatrix(); Translate(antena.X, 0, 0); Translate(0, antena.Y, 0); Rotate(rotation, false, false, true); Translate(-antena.X, 0, 0); Translate(0, -antena.Y, 0); Now I draw one point with this coordinates: double[] point1 = { 1, 2, 3 }; ...Now I need to backup OpenGL matrix to procced with Matrix multiplication ... double[] modelview = new double[16]; Gl.glGetDoublev(Gl.GL_MODELVIEW_MATRIX, modelview); double[][] modelviewOut = new double[4][]; modelviewOut[0] = new double[4]; modelviewOut[1] = new double[4]; modelviewOut[2] = new double[4]; modelviewOut[3] = new double[4]; int x = 0; for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { modelviewOut[j] = modelview[x]; x++; } } ...some code ... PopMatrix(); Now I need to draw one coordinate in the same place that point1 with no GlRotation. I think I need to multiply my point1 = { 1, 2, 3 } array matrix by OpenGL ModelView matrix (modelviewOut). Is this aproach correct? I not, how can I do this?? thanks in advance Operator

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• ### Forum Statistics

• Total Topics
633662
• Total Posts
3013231
×