9
\$\begingroup\$

i am working on an embedded system of a sort, and in some free time i would like to test its drawing capabilities.

System in question is ARM Cortex M3 microcontroller attached to EasyMX Stellaris board. And i have a small 320x240 TFT screen :)

Now, i have some free time each day and i want to create rotating cube. Micro C PRO for ARM doesnt have 3d drawing capabilities, which means it must be done in software.

From the book Introduction to 3D Game Programming with DirectX 10 i know matrix algebra for transformations but that is cool when you have DirectX to set camera right.

I gues i could make 2d object to rotate, but how would i go with 3d one?

Any ideas and examples are welcome. Although i would prefer advices. I'd like to understand this.

\$\endgroup\$
1
  • \$\begingroup\$ @Marin What have you done so far? I'm trying to achieve the same. Kindly contact me skype: andreahmed \$\endgroup\$ Commented Jul 9, 2014 at 21:18

2 Answers 2

7
\$\begingroup\$

You do realize that a directX camera is just a couple of matrix transformations? You have a ModelView, Projection, then Viewport matrix transformation to each vertex in that order to change the 3d coordinates to 2d coordinates.

More details about transformation along the standard pipeline (I believe DirectX and OpenGL both work the same way).

Then you rasterize the triangles based on the 2d locations(that resulted from your transformations) of the now 2d array of vertices you have. This can get complicated quick but using the PIT test and fully coloring any pixel that collides should be simple enough and effective in your case.

The other way to do this and the easier way is to make a ray tracer. Simply un-project the ray by using the transformation matrix you wish to apply on your object.

Haven't played around with low level sort of stuff in a while so I may be misremembering but either route shouldn't be too hard. Understand how the hardware pipeline works and implement it in software or write a ray tracer.

Btw this is where I learned what I know about the graphics pipeline.

\$\endgroup\$
2
  • \$\begingroup\$ Any programmable pipeline reference for OpenGL would also be useful since all transformations are manually coded now. \$\endgroup\$ Commented Aug 29, 2012 at 21:09
  • \$\begingroup\$ @Classic thunder. About the camera: yes i realize that. But i do not know how to transfer all that to this system. I thought that there is maybe some sort of equation to do this. Thus evading the matrix calculations. Maybe i didnt wrote question very well. About pipeline: they are same. Thanks! \$\endgroup\$ Commented Aug 31, 2012 at 19:24
3
\$\begingroup\$

In the days when 3D hardware was not available, we had to build our own 3D engines and polygon rasterizers. 3DICA is a great tutorial explaining all the basics of a software 3D engine. For me the images won't show up in Firefox, but in Internet Explorer they work fine.

Chapters 2.1 and 3.1 should be enough to cover your needs, but reading the whole tutorial should teach you a lot.

\$\endgroup\$
1
  • \$\begingroup\$ Wow. Nice stuff. I think that only thing i dont know from that page is part with splines. I dont have time to go through that in depth. For now. Thanks for that msell. \$\endgroup\$ Commented Aug 31, 2012 at 19:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .