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 / viewrange wrap around?!

Author
Message
crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 19th Nov 2005 11:28
hay guys, Im having a problem with a bit of code im trying to construct, and im wondering if someone with a bit/lot more knowledge can point me in the right direction.

firstly, My game engine uses a height map that generates the game map.
then i make a matrix the size of a window(for a better description), of the area you flying over. this is fine so far.
Then i put in some objects and and only show them if their in the viewrange ect....

Now all is ok so far, accept when u near the end of the map.
Now...... the process is, the camera fly's over the map, and moves freely in 3d space, the matrix is centered and follows the camera. When u reach the map thresholds u loop back around to the begining.
EG. map is 300*300
camera is allowed to move 300*tilesize then back to 0
but as u can imagine, when u loop back to 0 or even b4 u do, u cannot see the enemy's on the other edge of the map. and vice verca.

So, im left with a little task of wrapping another window around the map to get distance between me and the mobs.

Now this is the bit that has me stumped. i managed to sorta get x and z past 300 to work(sorta!) but cant figure out how to do it the other way. Or is there still a better way again.

here.... hopefully is the code i have for now that works(sorta)


Anyway, any help would be appreciated.

cheers
crighton

aye!
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 19th Nov 2005 20:18
Have you tried locking the camera at 0,0,0 and scrolling the matrix (and objects) in all directions under it?

TDK_Man

crighton
19
Years of Service
User Offline
Joined: 5th Nov 2005
Location: In your soup.
Posted: 20th Nov 2005 02:47
yes TDK_Man, that was the first engine style. But i thought it might be a little slow having to control all objects like scenery ect aswell.

With this way all scenery ect... is in place but only drawn if flown over, and mobs only drawn if they fly/move close enough.

I'm not really sure which way is better, guess i will have to write the game in both engines and see the difference myself.

thanks for the reply
cheers
crighton


aye!

Login to post a reply

Server time is: 2024-11-27 12:28:30
Your offset time is: 2024-11-27 12:28:30