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 / ugghhhh matrix's! Cant live with em cant live without em! I need help on centering 1

Author
Message
DBasic Khan
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location: Alpha Quadrent, Sector 1,1 SOL SYS
Posted: 16th Jan 2004 22:29
im working on a kinda random map generator for my fighter game. Right now to simulate water i have my main terrain dip down bellow a seccond matrix that has a water textur and is constantly randomizing itself. Like this
___ ____ <<main matrix dips>
\ /
\ /
--- \------/---<<Water matrix>>
\ /
\__/<bottom of main matix witch is hidden by the water matrix

My #1 problem with this is lag. at first i made the water matrix as big as the main 1. The problem with this is the computer just about exploded because it was working so hard trying to constantly up date the water matrix. Now im trying to set the water matrix to appear where ever the dip is (the dip is placed by picking a rnd(10) and adding 20, so it always is withing 20 to thirty grids in on the main matrix witc is currently 50x50). My question is this: what point on a matrix does matrix position x(1) represent? it that the absol;ute center x corrdinate? or the cornner x corrdinate? and is it possible to keep the water matrix to constantly randomize or should i drop that becaus eit would make the computer to stressed?
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 17th Jan 2004 01:42
matrix position x(1) is bottom left of matrix, same as y and z. Default is 0,0,0. Just place an object at that position and you would see this.

Having a constantly updating water matrix and a main matrix is probably not a good idea. You should get a speed increase if you only update water matrix every few syncs, not every loop. Alternatively do away with a water matrix and just have a big plain textured with a water texture and scroll the texture. You can get good results by having two plains slightly seperated with top one ghosted. Scroll the texture on both of them slightly different. You can also make these plains bob up and down slightly to look like a tide.

Boo!

Login to post a reply

Server time is: 2024-09-21 15:41:05
Your offset time is: 2024-09-21 15:41:05