seriously learnig NGD

Share with us how are you using the powerrrr of the force

Moderator: Alain

Re: seriously learnig NGD

Postby coimbra79 » Fri Aug 27, 2010 8:04 am

you have spent a good holiday? ... I'm not much ...
I returned, just now, to work on NGD,
I have implemented the use of treemesh. in this demo coiaxis light, shadow and environment maps are disabled ... What do you think?

- I noticed that some shots of 'bullet' (wheel scooter) pass through some walls, what would it be due?
- Delphi has suggested me to use treemesh, instead of the heightmap, what is different?

tnk again!
http://www.youtube.com/watch?v=14duBf4acPM
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Re: seriously learnig NGD

Postby Stucuk » Fri Aug 27, 2010 11:37 am

Debug Display should be implemented so you can see the physics represented on the screen. You may need Continuous Collision applied.
User avatar
Stucuk
 
Posts: 801
Joined: Sat Mar 12, 2005 3:54 pm
Location: Scotland

Re: seriously learnig NGD

Postby coimbra79 » Mon Aug 30, 2010 7:26 am

ok...
void* NewtonVehicleAddTire( const NewtonJoint* vehicle, const dFloat* localMatrix, const dFloat* pin, dFloat mass, dFloat width, dFloat radius, dFloat suspesionShock, dFloat suspesionSpring, dFloat suspesionLength, void* userData, int collisionID)

wath in userData? vertexs, face or whatelse? where some sample for addtire?
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Re: seriously learnig NGD

Postby coimbra79 » Mon Sep 06, 2010 12:07 pm

where some sample for addvehicle and addtire? plz!

seems to work the NewtonConstraintCreateVehicle, but then with the addTire ... it crash all
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Re: seriously learnig NGD

Postby coimbra79 » Sat Sep 18, 2010 8:34 am

wath for every tire in vehicle?
1-NewtonBodySetForceAndTorqueCallback?
2-NewtonReleaseCollision?
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Re: seriously learnig NGD

Postby coimbra79 » Tue Oct 05, 2010 9:10 pm

please! can anyone help me? I'm using the standard joint to build a vehicle, I finally managed to end the suspension (and since I can not use fully your SDK samples, it was very hard work and heavy!). Now I find myself with the problem of having to apply power to the wheels, I'm trying 'addtorque', but the matrix is not multiplied by this function automatically (as in rotate function of OpenGL, for example) ... Does anyone know an algorithm to recommend to ensure that any direction takes the vehicle, the wheels maintain a regular rotation on the HINGE axis? tnk!
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Re: seriously learnig NGD

Postby JernejL » Wed Oct 06, 2010 3:49 am

You mean, you want to apply rotation back to wheels if you externally force vehicle to move?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: seriously learnig NGD

Postby coimbra79 » Wed Oct 06, 2010 10:21 am

(Hopefully I have understood your question ...) if I push the vehicle towards one direction, of course, the wheels rotate on the right axis of the hinge. I served the opposite: turn the wheels to propel the vehicle (as happens in reality). when the vehicolo is oriented on X, the wheels will rotate on Z, then:
NewtonBodyAddTorque ObjVeicolo.Tires (0), vec (0.0, TorqueValue.) V (0)
NewtonBodyAddTorque ObjVeicolo.Tires (1), vec (0.0, TorqueValue.) V (0)


This simple formula is not appropriate, since, when the vehicle will be directed to Z, the wheels should rotate on X, then:

NewtonBodyAddTorque ObjVeicolo.Tires (0), vec (TorqueValue.0, 0). V (0)
NewtonBodyAddTorque ObjVeicolo.Tires (1), vec (TorqueValue, 0.0). V (0)

I ask an algorithm that allowed me to maintain a fixed rotation (when I apply the torque) axis of HingeJoint, regardless of the direction of the vehicle.
however I have solved this way:

'Revenue direction of the vehicle
NewtonBodyGetMatrix ObjVeicolo.NBody, MmATRIX.m (0)
'Are the rotational force, the X * matrix multiply (10)
'Are the rotational force on Z * by multiplying array (2)
NewtonBodyAddTorque ObjVeicolo.Ruote (0), vec3 (TorqueF MmATRIX.m * (10), 0, TorqueF MmATRIX.m * (2)). Xyz (0)
NewtonBodyAddTorque ObjVeicolo.Ruote (1), vec3 (TorqueF MmATRIX.m * (10), 0, TorqueF MmATRIX.m * (2)). Xyz (0)


(I have yet to implement the Y axis ..)
this works! However, the wheels slip on the ground and the vehicle is moving slowly (watch this) .
http://www.youtube.com/watch?v=5Sgad-ujmG4
I set the frictions and the materials for them, the wheels have the forceandtorquecallback ...
Why is it happening?
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Re: seriously learnig NGD

Postby coimbra79 » Wed Oct 06, 2010 10:34 am

I found this your post in forum:
by Delfi » 20 Sep 2010, 09:52
If it's about tires, then you probably mean lateral and longtitudal friction?


what the functions?
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Re: seriously learnig NGD

Postby JernejL » Wed Oct 06, 2010 11:04 am

Err.. it's friction? it's simple friction with variable amout of friction depending on direction of contact. That's what a tire does - it rolls along longtitude and sticks on lateral axis, and this is what you are simulating to make it work like a tire.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1578
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: seriously learnig NGD

Postby coimbra79 » Wed Oct 06, 2010 11:30 am

Delfi wrote:Err.. it's friction? it's simple friction with variable amout of friction depending on direction of contact. That's what a tire does - it rolls along longtitude and sticks on lateral axis, and this is what you are simulating to make it work like a tire.


Certainly (as in video) wheels rotate on a longitudinal axis, I miss the grip on lateral...
So how do I do this? what are functions i need to use? tnk!
User avatar
coimbra79
 
Posts: 42
Joined: Sun Jun 27, 2010 1:39 pm

Previous

Return to User Gallery

Who is online

Users browsing this forum: No registered users and 16 guests