monyman_324
monyman_324

Reputation: 21

How to draw 3D images?

I am working on a simple 3d software renderer but one thing I'm no sure about is how to actually draw it all on the screen. What could I use to draw a wireframed cube ? I am not asking HOW to write a complete 3D pipeline just the final step, the actual drawing on the screen.

Edit: I think I could do that with SDL.

Upvotes: 0

Views: 640

Answers (2)

user223264
user223264

Reputation:

For the "actual drawing on screen" in Windows XP of your software-rendered wireframe 3D, call StretchDIBits with a pointer to the array of bytes that represents your pixels. This answer addresses maximum convenience; maximum efficiency is another matter.

Upvotes: 0

ChrisF
ChrisF

Reputation: 137188

You need to project the 3D object onto the 2D screen using a perspective transformation matrix.

This will generate a set of 2D lines etc. which get drawn in the same way as "normal" 2D lines get drawn.

However, without more information about the language and/or framework you are using, it's not easy to go into any more detail.

Upvotes: 1

Related Questions