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.

Author
Message
Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 24th Aug 2005 10:19
hi how do i get object 1 to move up the Z axis 1?


I don't fear pain.....I fear feeling it.
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 24th Aug 2005 10:31
You could use something like this:

Do you want it to just move once, or do you want it to move several times?

If you want it to just move once, just call on that inc z1#,1 commands once only.

If you want it to move several times, include it like this: if upkey()=1 then inc z1#,1 or however you intend

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Aug 2005 10:38
First of all, you really need to take a look at the help files that came with DB. Just press F1. There's lots of info in there that would help you - including tutorials and sections that cover the basics.

Secondly, you can't have:

position object 1,-5,0,0=dog#

as it doesn't make any sense.

Position Object 1,-5,0,0 will position object 1 at -5 along the X axis, 0 along the Y axis and 0 along the Z axis.

If you make an object in DB, it will automatically be placed at X,Y,Z = 0,0,0 in 3D space.

X runs left to right on your screen.
Y runs from the top of the screen down to the bottom.
Z runs from the glass on your computer monitor away from you into the screen.

OK, so if we have just created a sphere and it's sitting at 0,0,0 then setting X as a negative number (ie: -20) will move it to the left and setting X as a positive number (ie: 20) will move it to the right.

It's the same with the Y axis. Make Y = 20 and it will move up. Make Y = -20 and it will move down.

Same again for Z. Setting Z to 20 will move the sphere away form you and setting Z to -20 will move the sphere towards you.

Your question was
Quote: "how do i get object 1 to move up the Z axis 1?"
.

As you said 'up' I have to assume that you want to move the object up and were getting confused with Y and Z axis.

To move an object up one unit, use variables instead of literal numbers in the Position Object statement. You can then change the values of the variables and the object will move. Eg:

Inc YPos#
Position Object 1,XPos#,YPos#,ZPos#

Hope that helped... and don't forget to do some reading in the help files!

TDK_Man

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 24th Aug 2005 10:45
thanks TDK_man and master programmer.

TDK i meant during the gameplay maybe i should have been more specific.also i meant along the Z axis sorry for the mistakes

I don't fear pain.....I fear feeling it.
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 24th Aug 2005 11:12
np - That is what you wanted, right?

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 24th Aug 2005 11:16
NP!

Incrementing ZPos# in my example above will move the object 1 unit away from you.

Try This:



TDK_Man

Milky the purple crab
19
Years of Service
User Offline
Joined: 5th Aug 2005
Location:
Posted: 25th Aug 2005 00:47 Edited at: 25th Aug 2005 10:47
thanks TDK.
can you tell me how to make the camera stay with an object like a fps please?

I don't fear pain.....I fear feeling it.
master programmer
19
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 25th Aug 2005 20:24
You can make good use out of the set camera to follow command or you can use some math commands to make it just the same (if not better). Like, making the camera stay on the x,y,z with minor corrections to keep the fell of a 3D person game (tutorials are around here somewhere. View the "Iced" demo for the code, or search CodeBase

Login to post a reply

Server time is: 2024-11-27 18:37:15
Your offset time is: 2024-11-27 18:37:15