DG Car question

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: DG Car question

Postby Julio Jerez » Tue Jun 23, 2009 2:20 am

Ok I put the Beta 2.03 (only the PC build for now)
http://www.newtondynamics.com/downloads/NewtonWin-2.03.rar

It fixes the Bug with the RayCast car that only allowed set car oriented along the x local axis, now the chassis matrix that define the car orientation works as it should.
With this feature the user will not have a physically rotate the car geometry, setting the proper chassis matrix will do the trick.

Code: Select all
For example to create a car joint with a car moving along the x axis you can do this
1 0 0 0  // car direction of motion in local space
0 1 0 0  // up vector In local space
0 0 1 0  // tire rotation axis in local space
0 0 0 1 // always zero vector

// if your can geometry is oriented alone the z asis , then you set the chassis matrix to this
// Vet I think this is your situation
 0 0 1 0  // car direction of motion in local space point alone teh z axis
 0 1 0 0 // up vector In local space
-1 0 0 0 // tire rotation axis in local space poin alon the x axis
 0 0 0 1 // always zero vector

Please try that and see if it is better.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: DG Car question

Postby VeT » Wed Jun 24, 2009 7:16 am

did you update only RayCastCar.cpp or dll is also updated?
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: DG Car question

Postby Julio Jerez » Wed Jun 24, 2009 7:28 am

every thing is updated apropietly specially CustomDGRayCastCar.cpp
you do not need to use RayCastCar.cpp exept for reference to see how to go about.

remember you do not need to mutiply the car axis matrix, to create a car you just do this after you create the rigid body
Code: Select all
NewtonCustomJoint *joint;
matrix[16] = {0, 0, 1, 0     0, 1, 0, 0     -1, 0, 0, 0,     0, 0, 0, 1};
NewtonCustomJoint *DGRaycastVehicleCreate (maxTireCount, matrix, NewtonBody* carBody);


this will make a car teh moves along teh z axis, as opposed to to the old tha moved sideways.
Plase let me knwo if it worked
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: DG Car question

Postby VeT » Wed Jun 24, 2009 8:15 am

//every thing is updated apropietly specially CustomDGRayCastCar.cpp
i asked because the size of dlls are the same :)


NewtonBodyGetMatrix(car_body,&tire_offset);
and
matrix[16] = {0, 0, 1, 0, 0, 1, 0, 0 -1, 0, 0, 0, 0, 0, 0, 1};
return the same result with sideway moving

on the other hand,
matrix[16] = {1, 0, 0, 0, 0, 1, 0, 0 0, 0, 1, 0, 0, 0, 0, 1};
works fine... i have no idea, why this happens :|
Last edited by VeT on Wed Jun 24, 2009 9:09 am, edited 1 time in total.
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: DG Car question

Postby VeT » Wed Jun 24, 2009 9:04 am

and what about wheels?
i create visual object, set matrix to position (20,20,-20), apply a large radius 55, but car ignores it

all 4 wheels made in the same way
Code: Select all
FLwheelPtr = ent_create("WheelL.mdl",nullvector,NULL);
   vec_set(tirepos,vector(20,20,-20));
   D3DXMatrixTranslation(&tire_offset, tirepos.x * QUANTTOMETER,tirepos.y * QUANTTOMETER,tirepos.z * QUANTTOMETER);
   DGRaycastVehicleAddTire(car_joint,FLwheelPtr,&tire_offset, 20,55,0.3,1.1,0.25,60,5,1);


looking like i missed something again
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: DG Car question

Postby Julio Jerez » Wed Jun 24, 2009 10:31 am

what is the problem?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: DG Car question

Postby VeT » Wed Jun 24, 2009 11:01 am

car ignores wheels at all... it just fall down and dont move in better case, or fly ahead.. i'll upload video soon, but what it can be?
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: DG Car question

Postby Julio Jerez » Wed Jun 24, 2009 11:19 am

Maybe they are too close, 20 conetoneter converet to meter is 0.2
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: DG Car question

Postby VeT » Sun Jun 28, 2009 11:58 am

No, i played with values, looking like problem in another

One more question: why DGRaycastVehicleAddTire need pointer to the graphic body FLwheelPtr as 3-rd parameter?
As you said, this is fake-physic car wich works with rays and i must render wheel meshes with the help of DGRayCarGetShasisMatrix
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Re: DG Car question

Postby Julio Jerez » Sun Jun 28, 2009 2:38 pm

I am writing a toturial tha I iwll send to Delfi so tah he can correct it and post in teh wiki.
Plus I am perfectingteh car joint.

Tha will clear all the confution.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: DG Car question

Postby VeT » Mon Jun 29, 2009 6:33 am

okay, thanks, i'll wait
.. and study working examples :)
1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy
LiteC+Newton2 download: http://hosted.filefront.com/NeArGa
LiteC+Newton2 discussion: http://tinyurl.com/6l7y9v
VeT
 
Posts: 84
Joined: Thu Jul 31, 2008 11:31 am

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron