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.

DLL Talk / Shakey camera with advanced terrain

Author
Message
Noonster
18
Years of Service
User Offline
Joined: 10th Jul 2006
Location: Idaho, USA
Posted: 24th Sep 2006 16:02
Hi all,

Rather than use a "boxed" terrain generating app, I'm trying to learn using advanced terrain. Just a couple of questions, if someone can help out:

1. Looking at example code, they all seem to use a small (as far as I can tell) scaling factor; typically SET TERRAIN SCALE obj num, 3, 0.6, 3. However, I have been using more on the order of SET TERRAIN SCALE obj num, 500, 20, 500 to keep it from looking like the camera/player is standing on a bumpy throwrug. Is this appropriate, or am I really messing things up? My heightmap is 256x256 and my texture and detail images are 512x512 as in the examples.

2. Perhaps in relation to the above, I have found that the camera (or the terrain) shakes or vibrates at times; typically when I turn/pan the camera to the left. However, if I then turn/pan the camera (even slightly) back to the right, the shaking stops. One thing that did seem to help (but not completely eradicate it) was to place UPDATE TERRAIN at the very beginning of the DO LOOP, but I could be wrong about this having any effect on the problem.

System:
Athlon XP 2600
512 MB memory
GeForce FX 5200 w/256MB

If it helps, here is the code for building the terrain:



And the DO LOOP code (the camera code borrowed from the Inca Pro code, if I recall correctly):



Any insights will be much appreciated, and sorry for such a long-winded post
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 29th Sep 2006 05:02 Edited at: 29th Sep 2006 08:03
I have not used advanced terrain, but the phenomenon you are experiencing in #1 above is called aliasing. The pixels in any image are square...as you zoom the image that becomes increasingly evident because the display is composed of more, or less square pixels, too. You could work on your terrain texture to try and smooth it out with gradients, but...I think CashCurtis and RiiDii use extreme zoom with terrain, and have already solved those issues. Apologies to all else who have done the same. That is not a dll issue, imo. Try in DBPro forum. Explain #1, and they will come to your rescue on that, I am certain.

I will check your code out, but the camera issue sure sounds like collision detection on the surface. I do not use any third party dlls at this time, but it still makes sense for me to test your code.

EDIT: I believe that your camera trouble is also related to the zoom factor. Do you also occasionally go beneath the terrain, or does your collision detection prevent that? Can you duplicate your shaky camera condition on flat terrain?
Noonster
18
Years of Service
User Offline
Joined: 10th Jul 2006
Location: Idaho, USA
Posted: 2nd Oct 2006 19:04
Thanks for responding, jinzai

Sorry for being so long in seeing your post, my family and I are in the middle of moving across the country. Stopped in at my mother's for a visit and was able to go on the 'net.

Anyway, just before heading out, I did replace the camera code with a simpler "follow the arrow keys" type code (no ability to use the mouse to look around). The shakiness did not show up. So, I have a feeling the culprit is actually my optical mouse. Later, I will try using a standard roller ball mouse to see what happens. Hmm, just hit me, I'll have to run the Inca Pro demo again and see if the shakiness happens there...

I'm too new to really understand your references to "zoom", but I assume that you mean the camera being close to the textured surface? Also, no, the camera does not go beneath the surface (I'm using NG Collision, BTW).

For issue #1, I'll take your advice and ask it in the DB Pro forum (probably be another week before getting to our new home and can post, tho -- argh).

Thanks again, I do appreciate your help.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 3rd Oct 2006 03:41
That is my bad...I meant scale factor. It works like a zoom, but I was asking if the shakiness might be related to the scale factor. (It would show up at a certain point and get worse as the scale went up.)

I have just gotten 3D Canvas...did not realize that it did terrains. Yes, your mouse might be at fault, but I think it is more related to the trouble of figuring out camera height over uneven terrain. If you use a big hammer method...like adding a fixed offest to the terrain height...the camera will bounce up and down like the terrain does. Sometimes, it will not bounce so much going sideways as it does fwd/bkwd.

Yes, I moved from VA to CA to IL to VA to IL with various family members in tow. Fun.

Login to post a reply

Server time is: 2025-05-18 02:35:47
Your offset time is: 2025-05-18 02:35:47