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 / Quick matrix texture question

Author
Message
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 19th Jan 2004 02:47
Im trying to create a dynamic terrain system, where the player/camera stays in the center of the matrix, while the matrix itself shifts while you move around. To do this, im going to have to retexture the entire matrix everytime you cross a 'grid' (unless there is a better way). So im wondering, is there anyway to map a single giant texture to a matrix (bypassing the whole section/grid thing)? Or do I need to break the texture up into chunks, and assign each one to each grid on the matrix?

All you need is zeal
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 19th Jan 2004 03:01
What you do is use the SHIFT commands which scroll the matrix textures, normals and heights. So as you cross a tile boundary, you shift the matrix, move the matrix and fill the edge textures, heights and normals from an array.

If you look on my website, you will find my alienware compo game which does exactly that. I've even posted the source code.

Game uses a 300 * 300 array but the matrix is only 79 * 79. So with some simple maths you can wander around the matrix and shift, move and populate it as you go. The advantage with this method is that game land can be as big as you want.

The game also has the level editor builtin so you can swap between play mode and edit mode at will. No documentation though but lots of rem commands should explain things well enough.

Boo!
Zeal
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Colorado Springs, CO
Posted: 19th Jan 2004 03:40
Killer I was wondering how exactly the shift matrix commands worked. So they save normal/height/texture data eh? Sounds like its wayyyy faster than reforming/retexturing the whole thing.

Checking yer code now, thanks a ton!

All you need is zeal

Login to post a reply

Server time is: 2024-11-26 01:44:54
Your offset time is: 2024-11-26 01:44:54