Sign in to follow this  
math3d

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

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this