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 / DBC Matrix Help

Author
Message
Insanity Complex
19
Years of Service
User Offline
Joined: 16th Sep 2005
Location: Home
Posted: 22nd Sep 2005 16:30
I'm trying to use matrix commands to make a plat ground to have a sphere hover over. I've gotten how to control the sphere and texture it as well. But when it comes to the matrix, all i can do is create a matrix that appears in the middle of the screen and is useless to me.
I need to know:
1)How to set the matrix to be on the bottom of the screen, but still seen by whoever is running the game
2)How to texture the matrix
3)How to make sure the sphere is neither below or too high above the matrix
4)If matrix is the right thing to use for this
5)How to create visible walls, and the invisible barriers that go with it
6)Possibly how to elevate certain areas of the matrix

-Thanx
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 23rd Sep 2005 03:17
Quote: "1)How to set the matrix to be on the bottom of the screen, but still seen by whoever is running the game"


You can position the matrix anywhere in 3D space using the POSITION MATRIX Matrix Number, X, Y, Z command, though doing so will mean that if you use the Get Ground Height command for collision, you will have to calculate the displacement amount into the command as it assumes the matrix is still at 0,0,0.

It's better to reposition the object and camera in the centre of the matrix instead.

If you create your matrix with variables, you can use them at any time in your program. For example:



You can then use:



Quote: "2)How to texture the matrix"


This is fairly complicated and you would be advised to read the matrix tutorial here:

http://www.computechtenerife.com/DB/tutorials.htm

Quote: "3)How to make sure the sphere is neither below or too high above the matrix"


The height you position any object above the matrix depends on the size you created the object. If you create a sphere for example using:

Make Object Sphere 1,20

Then the 20 is it's radius so you would position it 20 on the Y axis above the matrix. Don't forget that when you create an object in DB, it is ALWAYS created at X=0,Y=0,Z=0, so you have to move it.

When you move the object around, Get Ground Height will return the height of the matrix at the supplied X and Z position - you supply the X and Z position of the object in question.

Quote: "4)If matrix is the right thing to use for this"


Yes - unless you need something extraordinarily fancy looking and have the ability to work out the collision all for yourself.

Quote: "5)How to create visible walls, and the invisible barriers that go with it"


You need to create walls with a 3D modelling program, or build you own with DB primitives like Box and Cube. Either have to be positioned on the matrix correctly.

The invisible barriers as you call them is actually collision and you can set it for each object you create or load. Look in the help files in DB by pressing the F1 key and go to the commands menu. In the Basic 3D section you will find many commands which deal with collision.

Quote: "6)Possibly how to elevate certain areas of the matrix"


This can be done manually, but is time consuming. It's also covered in the tutorial I supplied the link to above.

Alternatively, you can use a matrix editor. Some people say MatEdit is quite good at this sort of thing!

TDK_Man

Insanity Complex
19
Years of Service
User Offline
Joined: 16th Sep 2005
Location: Home
Posted: 23rd Sep 2005 04:24
wow...didnt think any one person would cover it that sweet and to the point...thanx man i owe ya big

Login to post a reply

Server time is: 2024-09-24 05:30:18
Your offset time is: 2024-09-24 05:30:18