# how to use gdi or gdi+ draw a cube and rotate it ?

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

## Recommended Posts

--------------begin hi---------------- how to use gdi or gdi+ draw a cube and rotate it ? who can help me ? i hope use 3d math class. who can give some help .write a simple demo? --------------e n d hi---------------- only use gdi or gdi+ please help me.thanks very very much.

##### Share on other sites
this might help: http://www.kirupa.com/developer/actionscript/rotation_center.htm

##### Share on other sites
thanks,but i don't like flash.
i hope use c or c++ and gdi or gdi+

##### Share on other sites
I realize that, however you could probally adapt the math and formulas to c++...

##### Share on other sites
If you are gonne be satisfied with orthogonal view and wireframe filling then you simply have to calculate rotation matrice and multiply it with the position vectors of your vertices, and ignore the Z value to draw on your canvas :) "3d Transformation matrices" would be a good start for searching.

##### Share on other sites
if anybody give me a simple demo example,it is best.i wanna very very thanks.
i'm a newbie.please give me some help.thanks a lot.

##### Share on other sites
Hi. I found the following link, which contains C# code using GDC+ to draw a 3D cube. I make no promises that the code is good. No, it is not C++, but hopefully you can adapt it yourself.

Rotating a 3D Cube and Sphere with GDI+

Now...although I've provided a link to someone's example code, I do highly recommend that you go an learn about 3D projection matrices, and the 3D graphics pipeline yourself. If you hope to do any serious 3D programming, you will need to truly understand the underlying math and geometry.

##### Share on other sites
Having someone hand you a solution is not the best way to learn. Providing you with an "example" that you can directly use in your project without truely understanding it, will do you nothing.

All this would show is that you have the abillity to steal other peoples work.

Learn how to do things yourself, it is the only way that you will learn!

##### Share on other sites
thanks you all,you are right,i will try my best to lean .
thanks again. i see.

1. 1
2. 2
3. 3
Rutin
25
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633650
• Total Posts
3013118
×