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 / Is there a way to make a object have a parent?

Author
Message
DCP
18
Years of Service
User Offline
Joined: 16th Jun 2006
Location:
Posted: 21st Jun 2006 01:23
I am making a car game and I want to keep the wheels in the same position even when the car moves. How can I do this? Thanks a lot
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 21st Jun 2006 01:30
Limbs?
DCP
18
Years of Service
User Offline
Joined: 16th Jun 2006
Location:
Posted: 21st Jun 2006 01:34
umm?? I don't know, I just want the wheels to move with the car and stay in the same position.
Baggers
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 21st Jun 2006 09:55 Edited at: 21st Jun 2006 11:34
Limbs would do it...lets see if I can give you some example code...excuse me if this doesnt work I don't have DBP on this computer.

Quote: "
cls
sync on
sync rate 60

`Car body`
Make object box 1, 10.0, 10.0, 30.0

`Wheels`
Make object sphere 2, 5.0
Make mesh from object 1,2
delete object 2

Add Limb 1,1,1
offset limb 1,1, 5.0, -4.0, 15.0

Add Limb 1,2,1
offset limb 1,2, -5.0, -4.0, 15.0

Add Limb 1,3,1
offset limb 1,3, 5.0, -4.0, -15.0

Add Limb 1,4,1
offset limb 1,4, -5.0, -4.0, -15.0

`Position Camera`
position camera 0.0 , 20.0, 40.0
point camera 0.0, 0.0, 0.0

` Lets show it off now`

Do
yrotate object 1, (object angle y(1)+0.1)
zrotate object 1, (object angle y(1)+0.2)
Sync
Loop

end
"


Well I hope that helps (and works for that matter...I will check later when on a computer with DBP)
What should happen is a box (our car shell) should be made with 4 spheres (the wheels), one in each corner.
The "car" should then sit on the screen and spin.

I expect there is some horrificaly obvious mistake in there somewhere thatll embarass me later but until then I'll hope its fine.

If it works and ye need any more help, just say or drop me a line.


[EDIT]
Well look at that!..it works.
So yeah you can see how the "wheels" stay in the same position compared to the "car body".

M.I.A is pending

Login to post a reply

Server time is: 2024-09-25 01:22:56
Your offset time is: 2024-09-25 01:22:56