Sign in to follow this  
LEdxP37

delete

Recommended Posts

The www.gametutorials.com bsp tutorials had one with full collision detection and gravity/jumping/stepping. But they started charging for stuff, so I don't know if you can get hold of that tutorial now. But for decals, try this site: http://members.net-tech.com.au/alaneb/decals.html (decals = temporary marks)

Hope that helps.

-Bobo the Clown

Share this post


Link to post
Share on other sites
For the weapon you can switch of depth tests with glDisable(GL_DEPTH_TEST). Then it will be drawn over everithing else. The collition detection should also make sure you don't get too close to walls.

Share this post


Link to post
Share on other sites
Quote:
Original post by GamerSg
For your weapon, render your world/monsters/anything else first. Then switch to glOrtho(), switch of depth testing and draw your weapon last.


3D models in a 2D view tend to look funny. The only time you'd ever need to switch to the orthographical view, would be when you were drawing a 2D GUI/HUD (or a 2D weapon). ;)

Share this post


Link to post
Share on other sites
If you want some good ideas on how to do this stuff, why not grab the quake2 source code? I'm not sure of the best place to get it, but if you get stuck, pm me and I'll email you it or something. It's GREAT fun to play around with that code, and it'll give you some nice ideas on how to do things (and how NOT to do them too :))

Share this post


Link to post
Share on other sites
Quote:
Original post by Boruki
If you want some good ideas on how to do this stuff, why not grab the quake2 source code? I'm not sure of the best place to get it, but if you get stuck, pm me and I'll email you it or something. It's GREAT fun to play around with that code, and it'll give you some nice ideas on how to do things (and how NOT to do them too :))

Get it here (ftp).

Share this post


Link to post
Share on other sites
Quote:

For the weapon you can switch of depth tests with glDisable(GL_DEPTH_TEST). Then it will be drawn over everithing else. The collition detection should also make sure you don't get too close to walls.

Rendering unsorted polygons without the depth test could cause some weird artifacts. I think the best way would be to draw your scene, clear the depth buffer and then draw your gun.

[edited for clarity]

Share this post


Link to post
Share on other sites
I've got the 2nd beta of VS 2005, and I found it was missing some DirectX include files. They're probably deprecated but I also have Dev-C++ installed, and got it to compile by adding Dev-C++'s include directory (which has those files) to the end of VS's include path. You might be able to do that, or download an older (version 7 maybe) DirectX SDK and do the same there. Although the includes are missing, the functions within them are still in the DirectX libraries.

Of course if that isn't your problem, we'll need more information. Error messages would help.

[Edited by - Nathan Baum on May 28, 2005 3:39:57 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by The Rug
Rendering unsorted polygons without the depth test could cause some weird artifacts. I think the best way would be to draw your scene, clear the depth buffer and then draw your gun.

That might be a bit slow. If you don't mind losing a bit of depth precision, it would be faster to use glDepthRange. glDepthRange defines the mapping between depth in world coordinates and depth in screen coordinates.


// The scene will be 'squeezed' into the first 70% of depth-buffer depth.
// |#######---|
glDepthRange(0, 0.7);
drawScene();
// The gun will be 'squeezed' into the remaining 30% of depth-buffer depth.
// |-------###|
glDepthRange(0.7, 1);
drawGun();


You will also want to move the far plane close to the end of your gun, otherwise you may get depth aliasing problems.

Share this post


Link to post
Share on other sites
The glDepthRange() example is useful, but you have the ranges wrong -- the scene needs to be drawn into the [0.1,1.0] range, and the gun needs to be drawn into the (0.0,0.1) range for it to work. When the gun is drawn into a higher range, then the depth test will always fail.

Anyway, I would rather just clear the depth buffer before drawing the overlay/gun, and keep depth testing on (but perhaps change the near/far clip planes). Z clear is almost instantaneous on modern hardware. Thus, rendering is something like:

0) clear Z and color; set near/far to 1 meter / 1000 meters (or whatever)
1) render large, occluding things with depth write and test (possibly only into depth buffer)
2) render all opaque data (possibly once per light) with depth test and possibly no write (if you rendered all opaque Z in pass 1)
3) render far-to-near sorted transparent data with depth test and no write
4) clear Z; set near/far to 0.01 meters / 2 meters; render weapon

Share this post


Link to post
Share on other sites
to clear a specific region use glScissor for better performance, also when u clear depth also clear stencil.

also u have the right idea draw the gun first with range 0->0.01 and draw the rest of the scene afterwards with 0.01->1
this will run better than what most ppl have suggested, ie drawing the gun after the scene

Share this post


Link to post
Share on other sites
The Quake2 source code uses many assembly files by default. You have 2 options;
1. Change the build configuration to use ONLY the C-code (slower engine, but these days it's hardly noticeable).
2. Get MASM (ml.exe) which is the assembler you need to compile the source in original form. Copyright prevents me from posting it to you here but you can get it from a couple of places; the Win98 DDK (only available to MSDN subscribers) or in the Microsoft Processor Pack

Share this post


Link to post
Share on other sites
download the cube fps engine. it has what u want and the code is not hard to understand. ( at least it is not as huge as quake2, i do not recommend quake engines, they are really OLD!.. )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this