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 / matrix something strange

Author
Message
Smith Lock
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 18th Feb 2004 10:23
I'm trying to understand DBpro command by command.
here's what i suppose to be the exact matrix syntax:

MAKE MATRIX Matrix Number, Width, Depth, XSegments, ZSegments

So i have decided to play with a simple matrix parameters just to see difference in rendering.

When changing XSegments or ZSegments everything run like i want:
incrasing or decrasing tiles number.

But changing Width or Depth does not change anything to the visual aspect of my wireframe matrix.

There's something i don't understand with 3D world...

Here's my sample code:

autocam on
sync rate 30
sync on
w=1000
d=1000
make matrix 1,w,d,128,128
do
dec w
dec d
update matrix 1
print w
print d
print screen fps()
sync
loop

Heeeellpppppp....
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Feb 2004 12:06
Once a matrix has been created you cannot change its size or number of segments as there are no commands to do this.

Your loop does nothing except change the values of local variables!

UPDATE MATRIX is only used when you change appearance of matrix, like change height or texture.

Boo!
Smith Lock
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 18th Feb 2004 12:57
OK
That's right...

So here's my new code...

autocam on
sync rate 30
sync on
w=1000
d=1000
make matrix 1,w,d,128,128
do
dec w
dec d
delete matrix 1
make matrix 1,w,d,128,128
print w
print d
sync

loop

well now, i don't understand why nothing is change in the visual aspect of my matrix until w and d variables are <= 19 then the matrix size decrasing suddenly very quickly.

??????????
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Feb 2004 13:18
The reason is the AUTOCAM ON command. If this is turned on, then every object you create, be it a cube, matrix, e.t.c., then the camera is automatically moved so your object fills the screen. So the matrix is in fact getting smaller and smaller but the camera is being repositioned in such a way that you don't see it.

Also note the SET CURSOR command to reposition text cursor to top left each frame. This stops your values scrolling to bottom.

Try this:



Boo!
Smith Lock
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 18th Feb 2004 13:40
you're my personal christ spooky.
You're right again!

i know the SET CURSOR command but don't take care of it cause i don't want to do something very polished right now.

Just testing and understanding each 3D command.

As you can see i didn't test w or d to see if they're out of range.

My purpose was only to see the visual influence of parameters.

Humm... just another question...
What about corelation between units and real world.
I mean how to determine if a unit is 1 meter or 1 micron or 1 Kilometer...

One more question:

if i want to contruct a matrix lanscape, is it best to have many little matrix or just one big one (sounds funny in french "one big one").

I think one big matrix is less precise that plenty of litlle matrix.
Am i right?

spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Feb 2004 14:06
Regarding correlation between units and real-world. This is really up to your personal taste and has been discussed a lot in the past. It really makes no difference to speed of program but obviously big numbers get out of hand after a while and small float numbers are not very accurate. Just keep it simple, like 10 units = 1 metre or something similar.

DBPro matrices have no size limit like they used to, but be warned that anything bigger than 100*100 tiles and frame rate starts dropping drastically. In fact matrices are frowned upon by many experienced users in favour of memblock meshes. i.e. creating an object to mimic a matrix. Apparantly you can do all sorts of tricks with them, but they are not for a beginner like yourself. Personally I don't have problems with matrices.

If you want a big matrix for a game, your best bet is to have a small matrix, say 50*50 tiles, and use the SHIFT MATRIX commands to scroll the matrix features, and update the edges from an array.

If you goto my website and download my competition entry for the Alienware compo you will see lots of handy matrix commands. Source code is there as well.

It is basically a large level 300*300 tiles but the matrix is only 79*79 tiles. As player moves across tile boundaries, the matrix is shifted, moved and updated giving the impression of one huge level.

The advantage of this is you can have a level as big as you want but the matrix stays the same size.

PS. I also went through EVERY command, one by one learning how they worked. Have done this with every language as I think it gives you a better overall feeling of what's possible.

Boo!

Login to post a reply

Server time is: 2024-09-21 20:42:02
Your offset time is: 2024-09-21 20:42:02