Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TedMar, AndrewAMD), 1,344 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Physics and a car #280628
07/23/09 16:25
07/23/09 16:25
Joined: Jul 2009
Posts: 80
Area 51
F
fangedscorpion Offline OP
Junior Member
fangedscorpion  Offline OP
Junior Member
F

Joined: Jul 2009
Posts: 80
Area 51
I have a car model and I wanted to move it using physics. I already checked the manual and I typed in my code. When I try to drive the car around, the car moves unrealistically and flips over. I plan to have wheels for the car, so would I set the wheels as the collision object. The code for my car can be seen here:

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Main=34262&Number=280217#Post280217

Thanks!


"Pow! You are dead! Not big suprise!" -Heavy
Re: Physics and a car [Re: fangedscorpion] #280699
07/23/09 20:22
07/23/09 20:22
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline
Senior Member
MPQ  Offline
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
I do not really understand what kind of car model you are using. For a quite realistic car you have to use constraints (e.g. four wheels one chassis)


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: Physics and a car [Re: MPQ] #280706
07/23/09 21:10
07/23/09 21:10
Joined: Jul 2009
Posts: 80
Area 51
F
fangedscorpion Offline OP
Junior Member
fangedscorpion  Offline OP
Junior Member
F

Joined: Jul 2009
Posts: 80
Area 51
How do I accomplish this?

I have a chassis already built and I want to move it correctly.


"Pow! You are dead! Not big suprise!" -Heavy
Re: Physics and a car [Re: fangedscorpion] #280752
07/24/09 03:23
07/24/09 03:23
Joined: May 2009
Posts: 258
Chicago
J
Jaeger Offline
Member
Jaeger  Offline
Member
J

Joined: May 2009
Posts: 258
Chicago
I answered your other post. No need to make multiple posts in different sections on the same topic. Someone will help if they know the answer and have time.

I'm also interested in how to set up physics constraints for wheels and the likes. There are no tutorials or good examples, and the manual's explanation is virtually useless.

Btw, I see you are new. Is this your first project? If so, I'd suggest you try some simpler things first and come back to this. Physics can be rather frustrating, and nearly impossible for beginners to work with. But maybe you're just new to the forums. Dunno. Anyway, I hope someone can help. I need to know the same thing, and I've already got experience with the physics engine. Just no knowledge of constraints and wheels, etc, because there's virtually no info on it, and I've never gotten an answer here.

Re: Physics and a car [Re: Jaeger] #280762
07/24/09 07:06
07/24/09 07:06
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline
Senior Member
MPQ  Offline
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
If you like I write a little tutorial about car physics. Please answer if you like one.

Gamestudio Physics can be quite frustrating. At the moment i work on a racing game and it really needs a lot of time to get good results. At the moment i am working on it.


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: Physics and a car [Re: MPQ] #281097
07/25/09 14:54
07/25/09 14:54
Joined: Jul 2009
Posts: 80
Area 51
F
fangedscorpion Offline OP
Junior Member
fangedscorpion  Offline OP
Junior Member
F

Joined: Jul 2009
Posts: 80
Area 51
That would be so helpful man! Thanks for the help!
If possible could you try to write it in english or comment lines in english plaese? Thanks again!


"Pow! You are dead! Not big suprise!" -Heavy
Re: Physics and a car [Re: fangedscorpion] #281183
07/25/09 20:14
07/25/09 20:14
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline
Senior Member
MPQ  Offline
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
tutorial which explains the usage of constraints by means of an example:

3DGS CAR PHYSICS TUTORIAL ver 0.1


3DGS PHYSICS CAR TUTORIAL ver. 0.2

- some mistakes corrected
- static camera added

3DGS CAR PHYSICS TUTORIAL ver. 0.2.1

- pdf mistake removed

I think there are many mistakes inside the text, maybe tell me if you find some. Thanks

Last edited by MPQ; 08/01/09 12:20.

new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: Physics and a car [Re: MPQ] #281868
07/29/09 04:16
07/29/09 04:16
Joined: Jul 2009
Posts: 80
Area 51
F
fangedscorpion Offline OP
Junior Member
fangedscorpion  Offline OP
Junior Member
F

Joined: Jul 2009
Posts: 80
Area 51
what is wrong with this code?

var w1id;
var w2id;
var w3id;
var w4id;

var axis[3] = 0,1,0;
//var axis2[3] = 0,1,0;
//var axis3[3] = 0,1,0;
//var axis4[3] = 0,1,0;

var con1[3];
var con2[3];
var con3[3];
var con4[3];

vec_set(con1, w1.x );
vec_set(con2, w2.x );
vec_set(con3, w3.x );
vec_set(con4, w4.x );

con1.z = moke1.z - 50;
con2.z = moke1.z - 50;
con3.z = moke1.z - 50;
con4.z = moke1.z - 50;

w1id = phcon_add( PH_WHEEL, moke1,w1);
phcon_setparams1(w1id,con1,axis,NULL);
w2id = phcon_add( PH_WHEEL, moke1,w2);
phcon_setparams1(w1id,con2,axis,NULL);
w3id = phcon_add( PH_WHEEL, moke1,w3);
phcon_setparams1(w1id,con3,axis,NULL);
w4id = phcon_add( PH_WHEEL, moke1,w4);
phcon_setparams1(w1id,con4,axis,NULL);

I can not figure out this. It says there is an error with the first var axis[3] thing. what is wrong?


"Pow! You are dead! Not big suprise!" -Heavy
Re: Physics and a car [Re: fangedscorpion] #281872
07/29/09 06:16
07/29/09 06:16
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline
Senior Member
MPQ  Offline
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
use for vectors definitions: var axis[3] = {0,1,0}; or VECTOR* axis = {x = 0; y = 1; z = 0;}

Last edited by MPQ; 07/29/09 07:32.

new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Re: Physics and a car [Re: MPQ] #284616
08/14/09 09:21
08/14/09 09:21
Joined: Nov 2008
Posts: 354
saeculum II
MPQ Offline
Senior Member
MPQ  Offline
Senior Member

Joined: Nov 2008
Posts: 354
saeculum II
The fileqube servers have a problem at the moment :), so here the new download link to version 0.3

3DGS CAR PHYSICS TUTORIAL VERSION 0.3

- some mistakes fixed


new project in early stage...

Intel Xeon X3450 2,66GHz | Mushkin 8 Gib | Zotac GTS250 + 7300LE | A8.3 com
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1