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.

Newcomers DBPro Corner / Simple terrain question

Author
Message
Zeno
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location:
Posted: 23rd Feb 2005 00:57
Hi, plz could someone help me with a newbie question and a bit of code. I have made an .x terrain file with geoscape but i cant make it show up. When i load the prog it runs but i just get a blank screen. A code snippet to run the file properly would be helpful.
Thx
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 23rd Feb 2005 05:04
Does this do the job ?
Zeno
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location:
Posted: 24th Feb 2005 03:55
I tried the code but it still didn't work . The terrain file loads but is not visible.
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 24th Feb 2005 10:48
Zeno,

A couple simple things might be bighting you:

1. How big is the .X terrain you made, in terms of 3D units? It might be too small. In your game loop, try outputting OBJECT SIZE x(objnum), OBJECT SIZE y(objnum), and OBJECT SIZE z(objnum) to the screen as text if you don't know the answer.

If you see small values, like numbers below 10, try SCALE OBJECT and make it bigger.

2. WHERE are you loading the object in relation to your camera? Your camera will have a "near" and "far" range you set with SET CAMERA RANGE. Objects closer or farther away will be clipped. You might try outputting CAMERA POSITION X(), CAMERA POSITION Y(), and CAMERA POSITION Z() to the screen along with the terrain's position. This will show you how close you are to it.

If you don't set AUTOCAM OFF in your program, your camera is going to be moved to the location of the last object you created. You might be too close to see it.

Try explicitly positioning the object and your camera, and pointing the camera at it:

POSITION OBJECT 1, 0,0,0
POSITION CAMERA 50, 10, 50
POINT CAMERA 0,0,0

3. If you have SYNC ON, you'll need to issue a SYNC call or the screen won't be updated and you'll see nothing.

4. If the object completely flat? If so you might be viewing it edge-on and it's so thin you can't see it. If you suspect so, try XROTATE or ZROTATE'ing it between 1 and 45 degrees inside your game loop. You might suddenly see it spin into view and realize you were looking at a 1-unit high flat desert from the side.

Good luck,
Zeno
19
Years of Service
User Offline
Joined: 22nd Feb 2005
Location:
Posted: 26th Feb 2005 11:17
I finally got my terrain working . It was a simple case of camera positioning. Thx for the help guys

Login to post a reply

Server time is: 2024-09-23 12:27:34
Your offset time is: 2024-09-23 12:27:34