how can i draw 3d cube and rotate it in about any of 3-axes???
(in C-graphics)??
Thanks in advance
Code appreciated or at least describe the method.
Printable View
how can i draw 3d cube and rotate it in about any of 3-axes???
(in C-graphics)??
Thanks in advance
Code appreciated or at least describe the method.
You will need to use an graphics API of some description. There is no such thing as "c graphics".Quote:
in C-graphics
If you know a lot about graphics, then look at OpenGL or DirectX tutorials. If u havent done any graphics before, maybe learn something simpler, like Allegro. You should get into learning about 2d thoroughly before you move into the advanced 3d concepts.
hi,
by c graphics i mean using 3d transformations matrices and <graphics.h> functions i want to rotate a cube around vertical y-axis.
Now problem is how can i implement a third axis for drawing a cube??
Once this is established rotation thing is easy as i know a matrix
by which it can be rotated.But problem is how to implement
cube with 3axes geometry in c using line() etc. functions.
well, there are a lot of tutorials about this online. I would suggest searching for the following:
Denthor of Asphyxia
3DICA
the first one is hewavily outdated and has a couple of flaws, but the theory is still good, and *most* of the math works.
3DICA is very nice, though.
Look up perspective matrices and you will find your answer. Also might want to look up some linear algebra primers and such. Then you can use GDI and use pixels as vertices and LineTo for the lines connecting them, or a triangle filler if you want. I have done all of this using Software Rendering only. I also wrote my own Vector/Matrix library to utilize.Quote:
Originally posted by vishal2001
hi,
by c graphics i mean using 3d transformations matrices and <graphics.h> functions i want to rotate a cube around vertical y-axis.
Now problem is how can i implement a third axis for drawing a cube??
Once this is established rotation thing is easy as i know a matrix
by which it can be rotated.But problem is how to implement
cube with 3axes geometry in c using line() etc. functions.