View Single Post
Old 06-05-2017, 03:02 PM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,031

You can't directly. GDI+ doesn't support 3D drawing for the most part.
You would have to convert the 3D coordinates into a 2D representation of the 3D coordinates, and then draw using those 2D coordinates.

For example, I did some primitive 3D drawing in QBasic and early Visual Basic.
An example of a VB6 project testing out some basic concept of drawing 3d rectangles (as the faces of 3D blocks) can be found here, post #2.
That was back in 2005.

Some years later I got started with VB.Net.
Around 2013 I decided to drop that VB6 code into a VB 2010 project and change it to use the VB.Net provided GDI+ wrapped methods instead of the GDI API used in the VB6 code just to see how it would perform.
I wouldn't say that it is good .Net code since it is really old legacy VB code minimally modified, and is only test code at that, not production code.

In the .Net version, the A and Z keys still tilt the view, but now the I,J,K,L keys are used to move through and rotate the view.
I don't know it the code will help you understand the use of the Z coordinate any better, but something to look at and play with may be better than nothing.

You could also look at this thread which is a long exploration of the 3D drawing with GDI+ topic.
Attached Files
File Type: zip (29.8 KB, 7 views)
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Reply With Quote