Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to Translate,Scale and Rotate an object in c++ code?
Posted
Comments
JackDingler 14-Mar-12 11:07am    
C++ doesn't define these operations. They would be functions of a library or API that is working on some defined data sets.

Without further information, I'll assume you're talking about twelve dimensional inter-spatial manifolds. And my answer would be, I don't know how to do that....

But perhaps you're referring to DirectX, OpenGL or some other technology?

This smells like homework.
Sergey Chepurin 14-Mar-12 11:32am    
Here is the answer on similar question: http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/b7428d2c-ca91-496c-9e15-a1c57f29d5df

What object ?
Are you using OpenGL ? DirectX ?

Anyway, it's all more or less the same, you apply a transformation matrix to the object coordinates and let the system magically redraw the object with the transformation applied, or better, send the transformation matrix to the graphic system (with openGL, glPushMatrix, glMultMatrix,or wwith DirectX, D3DXMatrixTranslation, ... (but I'm no export on D3D) ) and send the vertices to the graphic system and the transformation will be done auto-magically.

If you do it manually, then you will have to do the transformation (matrix multiplcation, ...) in code, and there are tons and tons of example out there.

See http://en.wikipedia.org/wiki/Transformation_matrix[^] for maths of tranformation matrix.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Mar-12 12:05pm    
That saves this question from removal... :-) My 5.
--SA
CPallini 14-Mar-12 12:48pm    
My 5.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900