Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
    
@Marin What have you done so far? I'm trying to achieve the same. Kindly contact me skype: andreahmed –  Moaz Jul 9 at 21:18
add comment

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
Any programmable pipeline reference for OpenGL would also be useful since all transformations are manually coded now. –  edA-qa mort-ora-y Aug 29 '12 at 21:09
    
@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! –  Martin Berger Aug 31 '12 at 19:24
add comment

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.

share|improve this answer
    
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. –  Martin Berger Aug 31 '12 at 19:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.