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 / Car wheels as limbs

Author
Message
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 12th Jun 2003 13:12
I'm using a Buggy model that came with the "Beginning Dark Basic" book (a purchase which I'm beginning to regret) so that I can play with car physics. I've hit a rather silly problem straight away though...

Using rotate limb, the wheel rotates on an off-centre point, so it goes up and down, as well as round and round.

As far as I can see I have these options three:
1. Create my own model, making sure that the wheel objects' pivot centre are infact, the centre of the wheel.
2. Live with it, but reposition the wheel with each rotation.
3. Do something crazy with create object from limb(), remove limb(), fix object pivot(), and add limb().

I don't really want to do 1, cos I can't model. 2 just sounds like a crap solution. I tried to do 3 last night and I got a little stuck, round about the time where it came to removing the old limbs - DBP complained they didn't exist.

Does anyone know what I'm talking about? Better yet, can anyone come up with a moron-proof solution?

Please note: I'm at work now, which is why my "code" is so vague
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 12th Jun 2003 16:55
The models in DarkMatter are fine. Do you have DM, if so you could check them out.

I've never fiddled with them myself, but I have seen a demo which included the buggy, and the wheels moved as the car turned.

Thanks in advance.
All the Best,
StevieVee
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 12th Jun 2003 19:04
How do u get the models from Darkmatter 2 move?

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 12th Jun 2003 23:15
You can use the OFFSET LIMB command. Change the values until the wheel rotates right. Since it only moves up and down, you should only have to offset it in a y direction.

To get the DarkMatter models to animate, I think you just have to PLAY OBJECT or LOOP OBJECT. I've always done my own animation with the DarkMatter models.

Once I was but the learner,
now, I am the Master.
Mattman
21
Years of Service
User Offline
Joined: 5th Jun 2003
Location: East Lansing
Posted: 13th Jun 2003 00:19
Thx Darthster!!!

---Mattman
"Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done." Andy Rooney
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 13th Jun 2003 12:39
I don't have DM, which is why I want to get this one to work

Thank you very much - I'll try that offset limb command tonight!

(I'm looking to make a car physics model, so if all goes well, I'll make a tutorial)

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 13th Jun 2003 13:25
here is a rudimentary example.

cylinders in pro dont have the front faces but later on you will use x files instead of primitive mesh building.



adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 13th Jun 2003 21:13 Edited at: 13th Jun 2003 21:29
the offset limb command didn't reposition the centre of rotation, so it looks like I'm going to have to resort to the deconstructing of the object, then reattaching of all the limbs.
----
doh - that doesn't even work because when I remove a limb, it seems to delete other limbs. I guess I need to remove the wheels in a 3d package and save wheel.x to somewhere else...

While it's true that I can "loop object" the buggy, I feel I need to do this so I can learn about limbs...

adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 14th Jun 2003 00:17
I modelled box with 4 cylinders and tried to rotate the limbs using (guess) rotate limb. Irrespective of whether I break apart the model, use fix object pivot and then put it back together again, or just rotate the limbs straight from loading the .x file, the cylinders still seem to rotate around 0,0,0 - the centre of the object.

I really can't see how to get around this, although I'm sure people have done it without having to resort to animating the wheels turning.

Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 14th Jun 2003 01:17
As an example..I'm using this...

limbrot#=wrapvalue(limbrot#+(2*speed#))
rotate limb 2,3,0,limbrot#,0
rotate limb 2,4,0,limbrot#,0
rotate limb 2,5,0,limbrot#,0
rotate limb 2,6,0,limbrot#,0

for my 4 wheels and it works fine...
(of course you would put your object and limbs number in the example)
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 14th Jun 2003 01:43 Edited at: 14th Jun 2003 01:59
Just to try and illustrate what's going on...



I've guestimated an axle there, and drawn a link back to the centre of the object to try and show how the wheels are turning.... The only way I've gotten the wheel to turn as expected was to place it at the origin in the 3d modelling program, before exporting...

using this code btw



adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 14th Jun 2003 02:13
HOOOOOORAY!

answer was quite simple - make the wheels as separate objects, and load them as seperate objects but make sure they're created on the 0,0,0 axis when modelling.

They now turn properly!

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2003 06:14
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 14th Jun 2003 14:19 Edited at: 14th Jun 2003 15:08
Dammit - if it's not one thing it's another ...

Trying to rotate on two axes doesn't give the desired effect - the wheel "wobbles", generating movement in the x axis. It looks like the wheel's going to fall off!

euler rotation methods are crap!... the turn/pitch/roll object seems to suffer the same fate too. I'm sure I've seen some quaternion functions written for db somewhere - anyone seen them?

-----------------------------------------------------------

Ahhh. Let me quote to you from the good book ("Beginners Guide To DB Game Programming")...

"And when he saw set the commandment 'set object to object orientation()' he looked upon it favourably, for it fixed everything"

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2003 15:49
shizzle imagine this.

your limbs are hidden primitive meshes and an x model is attached to them via the glue object command. (the wheel)

the limb is like an indipendant axle and the wheel is a model.(x model)

rotate limb for the axles to turn and rotate object for the wheels to spin

sweet eh because u can lose a wheel with unglue then also

http://www.lunarpixel.com
http://www.lunarpixel.com/dt/
looking for something? try kangas search..temp mirror site http://www.lunarpixel.com/dbsearch/
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 14th Jun 2003 16:39
I've actually got it working properly now. At one stage, I tried out the idea of glueing the wheel object to an invisible limb, but, as we all know, I was having other problems.

At the moment, for every sync, I'm positioning the wheels relative to the chassis (using turn object left, move object etc...). This seems to be working nicely, because I'll be able to move the wheels more independantly since they're not strictly attached in any way.

I'll let y'all know how it goes.

Thanks for your help

Login to post a reply

Server time is: 2024-09-20 12:39:42
Your offset time is: 2024-09-20 12:39:42