How to draw a 3D cube w/o graphics library.
-
I want to draw a 3D cube without using graphics libraries such as OpenGL. I`m not sure how I can draw the cube. I don`t know what I need to do to draw something 3D.
See if you can pick yourself up a copy of the book 'Teach Yourself Computer Graphics' or something similar. This will show you how transform a 3D point x,y,z into a 2D point X,Y using a projection. The process uses matrices so you might want to be familiar with simple matrix transformations. Many texts on DirectX also explain this sort of thing but you don't have to use DirectX to take advantage of them if you're prepared to hand code the data structures yourself. Otherwise you might want to try old school drawing in VB6, you can draw directly onto a form pretty easily. I used this to port a simple 3D scene generator from QuickBasic to Windows quite a few years ago. Provided you can handle the mathematics 3D vector drawing is not really so difficult. When it comes to more complex stuff like lighting and shading you're going to need a good book you can follow as the algorithms can be tricky.
Nothing is exactly what it seems but everything with seems can be unpicked.
-
I want to draw a 3D cube without using graphics libraries such as OpenGL. I`m not sure how I can draw the cube. I don`t know what I need to do to draw something 3D.
You have to map cube 3D coords into screen 2D ones, you may choose, for instance, perspective transformation or (the simpler) isometric one. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke