• Welcome to Valhalla Legends Archive.
 

[C++] 3D Graphics

Started by Krush[LM], July 01, 2004, 08:30 PM

Previous topic - Next topic

Krush[LM]

Anyone know about 3D graphics using only the Windows GDI that could possibly help me out?  I need to do clip planes and field of view and some other things and I'm having problems doing it.

Eibro

I'm pretty sure the GDI is 2D only. Besides that, it's _slow_.
Eibro of Yeti Lovers.

Banana fanna fo fanna

Well all computer graphics are pretty much 2d.

Basically, you're gonna need the algorithm that translates a 3d point to a 2d one. In QBasic:

http://lightning.prohosting.com/~ichinar/Files/tuts/3d.txt

The important stuff you want is:

x2D = 256 * (x3D / (z3D + zCenter)) + xCenter
y2D = 256 * (y3D / (z3D + zCenter)) + yCenter

Then you can go ahead and implement everything on top of that! Good luck!

Adron

Quote from: Krush[LM] on July 01, 2004, 08:30 PM
Anyone know about 3D graphics using only the Windows GDI that could possibly help me out?  I need to do clip planes and field of view and some other things and I'm having problems doing it.

What are your problems more exactly?

iago

If you want to do cool stuff in 3d, I would recommend getting the DirectX SDK from Microsoft's site.  It comes with TONS of tutorials and examples of simple and complex things you can do.  Go have a look at the simple stuff, that should scare you away from 3d programming for awhile.

Good luck!

Also, you might want to look up OpenGL.  
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*



Adron

Quote from: $t0rm on July 06, 2004, 11:48 AM
Quote from: Krush[LM] on July 01, 2004, 08:30 PM
using only the Windows GDI

Well, that, and if he's currently having trouble with clip planes and field of view, he's probably already got the translation algorithm. Trying to help without knowing more exactly what his problems are would require either posting a link to a tutorial or guide (which he could google up himself) or typing a lot (which is too much of an effort when most of it may be wasted anyway).

So, let's hope he posts back with more exactly what he's doing, what results he's getting, and what problems he has.

Krush[LM]

It's for this computer graphics class in or I wouldn't even be touching windows gdi.

Krush[LM]

Quote from: Adron on July 02, 2004, 02:39 AM
Quote from: Krush[LM] on July 01, 2004, 08:30 PM
Anyone know about 3D graphics using only the Windows GDI that could possibly help me out?  I need to do clip planes and field of view and some other things and I'm having problems doing it.

What are your problems more exactly?

Well with the way I have it current implemented I changing the fov doesn't do much of anything.

Adron

Quote from: Krush[LM] on July 08, 2004, 09:41 PM
Well with the way I have it current implemented I changing the fov doesn't do much of anything.

Perhaps you have a flat projection and aren't using the fov at all?

Show the algorithm you're using?