PDA

View Full Version : Change values using translation



GreenCat
04-19-2005, 05:38 AM
The glTranslate translates objects on the screen.
I have put to a structure the values of some objects .

How can i translate objects on the screen and at the same time the values of the objects in the structure be changed accordly to the translation ?

The translation is happening by click and moving the mouse.

Should i use glMultmatrix? If yes how can i use it? Is there any way to multiply the matrixes so the values of the structure to be changed ?

Thanks

jide
04-19-2005, 05:56 AM
Simply use some basic vector maths, you know AB+BC = AC and such. Translations remains trivial as long as you don't face a new rotated basis.

zero_t9
04-19-2005, 07:50 PM
You can use glTranslate to define and glGet the matrix and multiply your vertices manually. Remember to reset your modelview/project matrix to identity.


Originally posted by GreenCat:
The glTranslate translates objects on the screen.
I have put to a structure the values of some objects .

How can i translate objects on the screen and at the same time the values of the objects in the structure be changed accordly to the translation ?

The translation is happening by click and moving the mouse.

Should i use glMultmatrix? If yes how can i use it? Is there any way to multiply the matrixes so the values of the structure to be changed ?

Thanks