Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / A bunch of questions about a 3D Near-Earth Game

Author
Message
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 9th Dec 2007 19:34
It appears that clipping is broken - that is to say, when a spaceship is behind the earth and should not be visible it's getting drawn anyway! Is there a trick to enabling the Z-buffer or something similar to prevent this?

Also my spaceship acceleration vector is broken - the spaceship accelerates in the wrong directions when up is pressed.

Lastly, I have a light inside the sun, which lights the earth and moon and spaceships nicely. Unfortunately, it doesn't light up the sun itself, since it's inside the sun! What would a good solution for lighting up the sun itself be? Something spectacular or dramatic would be nice, but I'd settle for just having it "lit"...something simple would be good too. I'll post all the code so you can read what I've got and help me. Hopefully this code will be useful to others too?

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Dec 2007 20:03
Quote: "It appears that clipping is broken"

You broke it when you did this:
dbSetCameraRange(0,99999999999999);

First, 0 is not a reasonable value for the near camera range (it should *always* be above zero), and secondly, 99999999999999 is not a reasonable value for the far camera range.

It's simple - your graphics card is probably providing a z buffer of 32 bits which provides a maximum of 4294967296 unique values. The actual usable number of unique values is probably less than this depending on the format of floating point number held in the z buffer.

Try using values of 1 and 10000 for now instead.

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 9th Dec 2007 20:10
I always put 0x7fffffff as the far range if I want something really big.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 9th Dec 2007 20:18
I, uh, need to fly really close to earth, since it's a near earth game, so the near clipping distance must be closer than 1! (Which happens to be 1-earth-radius...)...also what about my other questions??? Help!!! PS - thanks for answer, I'll try to debug it. Is there such a thing as a 64 or 128 bit graphics card?
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 9th Dec 2007 22:27
Also, what is the default directory that the application runs in when I press "f5" from visual c++ 2008 express? Is it the "debug" directory? The application directory? The root directory? Is it different at different times?
aersixb9
16
Years of Service
User Offline
Joined: 29th Nov 2007
Location:
Posted: 9th Dec 2007 23:05
Just as a random question - do I need to convert the 3 angles into a 3d unit vector and then add that to the velocity? How does one go about converting the camera angles into a unit vector?

Login to post a reply

Server time is: 2024-09-29 07:30:05
Your offset time is: 2024-09-29 07:30:05