My Tank Sim

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

My Tank Sim

Postby Scarabol » Fri Jul 16, 2010 4:52 am

Hi,

i want to make my own tank sim using Newton 2.20 and Irrlicht 3D Engine.

What i made so far?
Just look at this :-)
Image

My Demo works well. Im able to drive around or drive over some over objects and stuff like that.

Now i want to make the chassis unit behave in a more realistic way, especially the chain should adapt objects.

How can i manage to do this?

MfG
Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: My Tank Sim

Postby Scarabol » Fri Jul 16, 2010 8:21 am

ok, here is my next step

Image

I got a large amount of chain links and connected them using this:
Code: Select all
         float pivot[3];
         pivot[0] = chainlink->getPosition().X + chainlink->getJointNode("Link")->getPosition().X;
         pivot[1] = chainlink->getPosition().Y + chainlink->getJointNode("Link")->getPosition().Y;
         pivot[2] = chainlink->getPosition().Z + chainlink->getJointNode("Link")->getPosition().Z;
         float pindir1[3];
         pindir1[0] = 0;
         pindir1[1] = 0;
         pindir1[2] = 1;
         NewtonJoint *link = 0;
         link = NewtonConstraintCreateHinge(nworld, pivot, pindir1, chainlinkbody, lastchainlinkbody);
         NewtonJointSetStiffness(link, 1.0);


But as you can see on the screen, the chain links are not connected close enough. I thought SetStiffness could manage this, in case it does not.

How can i manage to connect the chain links closer or "stronger" together?

MfG
Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: My Tank Sim

Postby JernejL » Fri Jul 16, 2010 2:22 pm

The fast solver may not handle such tracks very well, you may have to change solver to a more exact one.

Depending on what you need it you can just simulate tracks by manipulating body ground contacts.
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: My Tank Sim

Postby Scarabol » Fri Jul 16, 2010 2:37 pm

I used:
NewtonJointSetStiffness(link, 1.0f);
NewtonBodySetLinearDamping(chainlinkbody, 1.0f);

Now everything works well. But how can i manage to "close" the chain?

MfG
Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: My Tank Sim

Postby JernejL » Fri Jul 16, 2010 4:48 pm

just.. reconnect the first and last element of the chain..
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: My Tank Sim

Postby Scarabol » Wed Jul 21, 2010 1:39 am

No sorry wont work because the jont has the same length as the distance between this to elements.

Can i set the length or something like this?

MfG
Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: My Tank Sim

Postby JernejL » Wed Jul 21, 2010 2:01 am

I don't understand the problem.. can't you just.. assemble it in a circle, and then position each piece to fit it around the tank wheels?
Help improving the Newton Game Dynamics WIKI
User avatar
JernejL
 
Posts: 1587
Joined: Mon Dec 06, 2004 2:00 pm
Location: Slovenia

Re: My Tank Sim

Postby RobbRob » Wed Jul 21, 2010 3:24 pm

Hi Scarabol

well, I am working on a Newton integration with Irrlicht under Linux, would it be possible getting your code for this simulation?

just a question, if not it's quite ok,

Thank's

Robert
RobbRob
 
Posts: 7
Joined: Sun Jan 03, 2010 4:55 pm

Re: My Tank Sim

Postby Scarabol » Wed Jul 21, 2010 4:16 pm

I have to think about but maybe i send you the code via PM, it's not that much...

Assemble the chains in a circle is a good idea. I want to check if the joints are correct, how can i display them?
Maybe with a special color for a certain pollution?

MfG
Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am

Re: My Tank Sim

Postby Scarabol » Mon Jul 26, 2010 12:48 pm

I got it the chains are assembled correct now!

Here is my current screenshot:
Image

Im now working on the chains to be connected to the wheels.
First they have to be fixed so they can't move (in driving direction) left or right, but up and down and forward and back.
And second the torque of the accleration wheels (connected to the engine, in real life) should be applied to the chain.

Any ideas about this are very welcome!!!

MfG
Scarabol
Scarabol
 
Posts: 24
Joined: Sun Jan 25, 2009 9:21 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron