News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Combination of a few examples...

Started by Krozgen, April 26, 2006, 01:50:52 AM

Previous topic - Next topic

Krozgen

I've been working for a few days trying to get my head around OpenGL using the Examples in the archive, and man, it's going great :) So far I've got a nice debug output thanks to the Direct Input example, some nice polys (Simple Object), camera movement from the Skybox and Camera, as well as some Direct Input bits. The mouse Z (wheel) now controls the color of the polygons, in a way, I've got movement with the keyboard and mouse down (it's just like an FPS! Heh...), and it's looking promising.

If anyone cares to check it out, and please tell me how to optimize it, that'd be awsome :)

Thanks.

- Kroz

-- edit --
I halved the speeds for the mouse looking, making it a bit more tolerable, and also added a "floor" that should go 100 pixels out in all directions - but I tried "walking" out to the end of it, and it just keeps on going... not sure why yet ^_^;;

Updated zip, should contain source as well as exe now.

[attachment deleted by admin]

Mark Jones

Nice work. :bg

It's halfway to Wolfenstein 3D status, hehe. :U
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

P1

The contruct program is finnished.  But I thought we agreed on all white with 2 old chairs.   :green2

Regards,  P1  :8)

Krozgen

Muhahaha... you can be sure, P1, that when I figure out how to export verticies' coordinates from Alias Maya into an OpenGL friendly format, you'll have your chair :-D

My next goal will be gravity; I'd like to be able to bounce a ball, but before I do that, I want to start storing my verts into arrays, in order to make a class/struct... that way, I have a "collidable" property or somesuch that I would apply to the ball and floor... man, collision checking's going to be a pain :)

... Then come the Nazis and guns, Mark Jones :)

I could've sworn they said "Halt, dog!" but apparently it was "Achtung!" (http://www.mac-archive.com/wolfenstein/talk.html) :toothy

u

Just don't forget the Z-buffer  :toothy
For collission detection, now just use spheres and boxes :)
:U
Please use a smaller graphic in your signature.

Krozgen

Z-buffer? I'm a little bit new to this :red What do you mean by that?

And as to the collision detection, I was just going to compare coordinates, which is what I'm assuming you mean by spheres and boxes. If the plane that's the floor is flat, it's easy enough to see if the movement of the sphere would either pass through the floor or overlap with it, in which case a collision occured. If there's a better way to do this (in 3D!) please let me know.

u

the Z-Buffer (also known as depth-buffer) is used to correctly draw 3D primitives.
Notice when you view the two boxes (in your app) so that box2 is drawn in front of box1, box1 will look like out of this world. (instead of being behind box2). Z-buffering solves this problem automatically (and thus is used in all 3D games, except for those for PlayStation1).

Collision detection can be done in many many ways, yours seems a good start.
Please use a smaller graphic in your signature.

Krozgen

Quote from: Ultrano on April 27, 2006, 10:09:30 PM
Notice when you view the two boxes (in your app) so that box2 is drawn in front of box1, box1 will look like out of this world. (instead of being behind box2). Z-buffering solves this problem automatically (and thus is used in all 3D games, except for those for PlayStation1).

Um... I don't see what you're talking about e.e;;; maybe the code from the original post is far outdated, even by now (I work in rapid bursts, at least 'till Summer Break). I think Frank Charlet took care of that, because honestly, I can't see through it.

Oh, I do recall now - I added a few lines from the "Hidden Lines" sample. Specifically, it seems to be this one that (overall) is keeping it looking nice:

invoke   glEnable, GL_DEPTH_TEST

I'm assuming the depth test is what you were referring to with Z-buffering...?

Thanks again :)