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
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 8th Sep 2004 20:15
Well lets see, the one thing I thought would be easiest doesn't work for me. I'm trying to make it so if i press the right key(rightkey()=1) then i want my cube to rotate to the right. I tryed the yrotate with no avail.

if rightkey()=1 then yrotate object 1,1

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Philip
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 8th Sep 2004 22:22
The Y rotate command rotates not around the cube's local Y axis but around the world's cardinal Y axis. If you want to rotate around the cube's local Y axis you should either:

1. use the turn object command; or
2. use Wolf's EZrotate plugin.

Btw: I assume in this post that you are using the +Y axis as representing the default "up" direction.

Cheers

Philip

What do you mean, bears aren't supposed to wear hats and a tie? P3.2ghz / 1 gig / GeForce FX 5900 128meg / WinXP home
Flashing Blade
21
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 9th Sep 2004 02:24
also:

if rightkey()=1 then yrotate object 1,1

might need to be:

if rightkey()=1 then yrotate object 1,wrapvalue(object angle y(1)+1)


The word "Gullible" cannot be found in any English Dictionary.
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 9th Sep 2004 05:51
Ya I never got that wrapvalue thing, can you explain it a little better.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Sep 2004 06:04
it converts a number to continually be within 1 and 360, kind of like a clock continually wraps the 1-12/0-59 numbers.

So lets say your variable is 340 - youd get back 340 back from wrapvalue

but if your number was 400, youd get back 40

heres an example of wrapvalue but written in dbp code, not using the built in function (written by IanM):



hope that helps explain it


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 9th Sep 2004 06:13 Edited at: 9th Sep 2004 06:18
Ok, so what exactly is the use of it?

edit

There's the complete code so far. as you can see it's supposed to rotate when i press the --> key but it doesn't.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 9th Sep 2004 06:47
the cube's y rotation is not the same as it's y position.

you use:

cubey# = get ground height(1, cubex#,cubez#) + 10.0
if rightkey()=1 then yrotate object 1, wrapvalue(cubey#+cubey#+1.0)

now, if the ground is flat, cubey# would always be 10.0
when you yrotate the object, it always rotates the y axis 10.0+1.0

You need to get it's y angle and add a number (or substract) it from it.

if rightkey()=1 then yrotate object 1, wrapvalue(object angle y(1)+1.0)

It's the same for a clock:

if minutes=60 then set hour(current hour + 1)

and not:

if minutes=60 then set hour(1)

Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 9th Sep 2004 07:45
now i want the cube to move in the direction it's facing.

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Sep 2004 08:01 Edited at: 9th Sep 2004 08:02
move object




DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!
Rennekon
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location:
Posted: 9th Sep 2004 08:05
And is there any explanation for that, I mean where to put it, what to put with it. I tried move object 1,4 and it just canceled out my rotate left and right commands. Reasons? Explanation? More than a command name?

John "Dark Lord of Angel Destroying Destiny" Pringlebee, maybe?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 9th Sep 2004 08:12 Edited at: 9th Sep 2004 08:13
I immediately edited my post to include the help file snippet before you posted again. I am assuming you have the help file with dbp, and are using the syntax listed there to try and accomplish your task.


DBP_NETLIB_v1.4.3 DarkTOPIA site coming soon!

Login to post a reply

Server time is: 2024-09-22 23:38:04
Your offset time is: 2024-09-22 23:38:04