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 / Steering a 3D model car

Author
Message
Geoff
16
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Sheffield (U.K.)
Posted: 27th May 2012 18:46
I have got DarkMatter 1, and have managed to drive the red car around in a circle. My code below:-



My question:-
I have not yet succeeded in getting the 2 front wheels to react as though the car is being steered.

How can this be done, please?
Regards, Geoff.

P.S.
At this early stage I am not yet concerned about the mathematics necessary to simulate accurate alignment with the car's route. But I wouldn't be at all offended if someone makes any suggestions.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 27th May 2012 21:28 Edited at: 31st May 2012 19:24
Not familiar with that model. Do you know, are there limbs at the front wheels? If so, you could base the wheel limb Y angle on the car's Y angle.

So many games to code.......so little time.

Attachments

Login to view attachments
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 27th May 2012 22:32 Edited at: 27th May 2012 22:33
if the wheels are separate limbs ( 4 of them ) you can turn them with the rotate limb command.
I will upload a small example i made some time ago
cheers

Attachments

Login to view attachments
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 27th May 2012 22:35
Forgot to tell that the wheel axis (pivot point) must be at the rotation center of the wheel
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 28th May 2012 03:50
Scorpyo, that is pretty cool.

So many games to code.......so little time.

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 28th May 2012 08:08
would be interesting to see this implemented into a physics system too like PhysX

Geoff
16
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Sheffield (U.K.)
Posted: 28th May 2012 09:46
Thank you everyone for your help.
My present position:-
Yes, each wheel in this model is a limb.
If I use Rotate Limb on the Z axes of the front wheels, and do not move the car around its circle, then it does show the front wheels correctly as though they have been steered.

BUT if I run my loop, and include the frames that drive the wheels round, then the front wheels flap about crazily.
If I exclude the driving frames, the front wheels show my steering angle correctly, but, predictably, none of the wheels are being driven (they just slide along the ground).

Scorpyo, I suspect that I need to take account of your tip that "the wheel axis (pivot point) must be at the rotation center of the wheel". How can I do this, please?

(I am going to study your great example program, but it's some way out of my current depth)

Regards, Geoff.
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 28th May 2012 20:59
If the pivot point is not natively at the wheel center of rotation there's not much that you can do.
That's usually set by your 3D modeler when building the wheels.
And sometimes converting formats (like .3ds to .x for example) will displace everything.
two points:
- have you tried to spin the wheel on a different axis from the current?
- Is the car natively animated i.e. instead of turning the limbs just use play object?
I'll attach a small basic utility i made for my own purpose. Just put it in your model(s) folder , run it , load your model, once loaded,with L you can browse limbs one by one.
With 1,2 and 3 you can rotate the current limb x,y, z wise and see if it is centered.
There are instructions within anyway
Good Luck

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 29th May 2012 00:27 Edited at: 31st May 2012 19:27
I would be willing to re-rig and animate the car for you, but since you purchased it, you are not allowed to send it to me. As I remember, the cars from DarkMatter1 were really low poly.

As an alternative, I am willing to try and re-create and rig a similar car in a 3D modeling program for you. I would need you to take screen shots of it from each side and I will try to reproduce something like it.

So many games to code.......so little time.

Attachments

Login to view attachments
Geoff
16
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Sheffield (U.K.)
Posted: 29th May 2012 10:58
Thank you LBFN, for your offer.
I have now prepared 6 *.jpg files, each showing one of the car's six sides.
I have never uploaded files to one of these threads before; how can I get these files to you?
Please don't spend a lot of time on this task, I shall be nicely occupied for quite some time examining all the tips contributors have given me.
Regards, Geoff
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 29th May 2012 16:03 Edited at: 29th May 2012 16:04
Geoff,

You are welcome, I am glad to help. You can simply email me the files and I can go from there. I do go back to work today, but shouldn't take too long to make something similar; I would estimate a few days. You would do well to learn how to model and animate. A suggestion I would have would be Wings 3D:
http://www.wings3d.com/ I originally started 3D modeling with this program and they have made it a lot better since then.

For the future, when you post there is a browse button at the bottom of the 'Post Forum Message' box. If you click that, you can select the file that you want to post on the forum (needs to be .jpg or .png format).

So many games to code.......so little time.

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 31st May 2012 19:30
I am making progress on the car model. Just for fun, I textured it with the images you provided to show the shape is very similar. I cannot export it like this (don't want any conflict regarding the DarkMatter pack), and will put a different texture on it.

Textured:



The wireframe:


It is 450 polies so far.

So many games to code.......so little time.

Geoff
16
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Sheffield (U.K.)
Posted: 31st May 2012 21:24
I am in awe of your modeling skill, and am looking forward to seeing the finished model.
I have got MilkShape, and am progressing (very slowly).
I am currently learning programming techniques from studying Scorpyo's uploaded program (thanks Scorpyo)
Geoff.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 1st Jun 2012 21:12
Thank you for the kind words. I have the model pretty well done now, but have not rigged it yet, as I want to see how the texture comes out first. The body shape seems to come closest to resembling a Fiat Panda, so that is what I am working on at this point.

So many games to code.......so little time.

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 4th Jun 2012 02:14 Edited at: 5th Jun 2012 15:20
I am disappointed in how the texture turned out. I have the car working (to a point) using Scorpyo's code, but if I turn the front wheels while it is moving, they get all messed up. I can turn them while the car is not moving fine. I tried re-rigging the car differently, but no joy.

EDIT: Got it working with Scorpyo's code! (okay, I made a couple of edits). The front wheels turn in the direction the car is moving, as they should. I found that the joints had to all be set at the same exact Y position in order for them to roll and turn properly. I can email you the model if you like, but I would like to work on the texture some more.

Post Edit:
Here is Scorpyo's code revised to work with the model.


So many games to code.......so little time.

Login to post a reply

Server time is: 2024-04-27 07:24:15
Your offset time is: 2024-04-27 07:24:15