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 / Spin the Objects

Author
Message
Lemming
21
Years of Service
User Offline
Joined: 5th Mar 2003
Location:
Posted: 12th Mar 2003 02:43
Hi, I new to DB and have a really simple question. I have planets in my space game and want them to spin. They are made from a 3D Model maker, not the "make object sphere" command. When I type the "rotate object" command it doesn't spin the object. Can someone tell me the code to make an object spin?
Dark Basic is better then Dim Basic.
<(^_^)>
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 12th Mar 2003 02:52
i think u need YROTATE OBJECT
Lemming
21
Years of Service
User Offline
Joined: 5th Mar 2003
Location:
Posted: 12th Mar 2003 03:00
No... I mean I want the object to be constently spinning.

Dark Basic is better then Dim Basic.
<(^_^)>
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 12th Mar 2003 03:03
Perhaps what you're doing wrong is actually setting the angle, rather that the angular velocity. To get something to rotate, you'll need a line like this:

yrotate object 1, wrapvalue(object angle y(1) + 10)

You see, typing in a fixed value for the angle will set the object to that angle. Hence, you need a way to constantly increase/decrease the angle. Above, I've used some nestled commands which effectively add 10 to the current Y angle and then sets it to within the 0-360 range. You could, of course, use a seperate variable for this, but it's entirely up to you.

Hope this solves your problem!

"I am a living, thinking entity who was created in the sea of information."
Lemming
21
Years of Service
User Offline
Joined: 5th Mar 2003
Location:
Posted: 12th Mar 2003 03:33
Nope, the object still doesn't budge. Can you tell me what you mean by seperate variable. Please excuse my stupidity, I'm new at this.

Dark Basic is better then Dim Basic.
<(^_^)>
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 12th Mar 2003 07:20
if you don't want to move'em anywhere then you can just use

where planet is your object number and step_value is kinda how fast it'll turn. Higher numbers faster.

if you animate it in a modelling package then i reccomend putting a "handle" inside of it, which you can link the planet to.
the handle will never be seen s it's usually like a blank 6 poly cube.
then you can animate the planet in your package, set object speed in db, loop object in db, and when you want to move it grab it by the "handle" which stays oriented get it?

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 12th Mar 2003 20:45
Hang on, I don't quite know what level you're at in DarkBasic, but you do have a loop, don't you?

Here's a simple loop that will rotate object 1:



And, by seperate variable, I mean the 'yangle' thing that's in the snippet, rather than using the object angle y() command.

"I am a living, thinking entity who was created in the sea of information."
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 12th Mar 2003 20:46
Oh, one thing - the 'angle' inside the brackets should read 'yangle'. Oops.

"I am a living, thinking entity who was created in the sea of information."
Andy Igoe
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 12th Mar 2003 22:05
Or...


Pneumatic Dryll, Outrageous epic cleric of EQ/Xev
God made the world in 7 days, but we're still waiting for the patch.
Lemming
21
Years of Service
User Offline
Joined: 5th Mar 2003
Location:
Posted: 12th Mar 2003 23:41
I've done what you guys told me, but it either locks up my game or just doesn't work. Here is the last one I tried, and it locked up my game.

What's wrong???

Dark Basic is better then Dim Basic.
<(^_^)>
Jimmy Cool
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: United States
Posted: 12th Mar 2003 23:48
right.. well um.. here?



works for me...

***********************************************
Me, i'll just be here crying my brains out

Login to post a reply

Server time is: 2024-11-27 23:41:23
Your offset time is: 2024-11-27 23:41:23