Tank simulation question
Tank simulation question
Tank simulation question
Tank simulation question
Tank simulation question
Tank simulation question Tank simulation question Tank simulation question Tank simulation question Tank simulation question Tank simulation question Tank simulation question Tank simulation question
Tank simulation question Tank simulation question
Tank simulation question
Go Back  Xtreme Visual Basic Talk > > > Tank simulation question


Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2009, 09:26 AM
zozie zozie is offline
Newcomer
 
Join Date: Aug 2008
Posts: 10
Default Tank simulation question


Hi all;

Got a good brain test for all of us.
I'm writing a simple 3 tank simulation in VB.net with Directx. I have all the animations and the game itself nailed down but I'm having a heck of a time trying to figure out single joystick control and tank style differential steering.

the problem is as follows:
The left stick on my USB gamepad is X and Y.
The value of each is 0 to 1000, with 500 at center.
When I move the joystick forward I want both treads on the tank moving forward. If I give it left input as well, the speed of the treads on the left side should slow down. If I give it right, vice versa. If the stick is centered, they should both stop. I want to replicate the way real tanks work and turn on a single stick cause the right stick is for the turret rotation and cannon up and down.
From a stand still, if you move the stick left, the left treads should be moving backwards, the right forward.
I thought I would find the answers on some robotics websites but I didn't

Here's another link to explain it better
http://rossum.sourceforge.net/papers/DiffSteer/

Sure I could just simply use "car like" steering but I want it to be as accurate as possible with realistic

I've been thinking about this for days and can't figure it out......
any thoughts?
Reply With Quote
  #2  
Old 11-27-2009, 09:58 AM
Iceplug's Avatar
IceplugTank simulation question Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

Well, I fail to see exactly how this is different from car steering if the tank is still turning when you tell it to turn. The only difference seems to be that the tank turns on a dime and that you seem to be focused on how the wheels operate on the tank - simulating the forces seems way too unnecessarily complex.

But, for steering, you'd just use an angle with Cos and Sine:
Tank.X += Spd * Math.Cos(ang)
Tank.Y += Spd * Math.Sin(ang)
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #3  
Old 11-27-2009, 01:59 PM
zozie zozie is offline
Newcomer
 
Join Date: Aug 2008
Posts: 10
Default

It is different then car steering, since the way the program is written, the machine moves as the treads dictate. It only turns when the speed is different in the 2 treads. It works fine with 2 sticks but that takes the fun away....
Reply With Quote
  #4  
Old 11-27-2009, 02:51 PM
Iceplug's Avatar
IceplugTank simulation question Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

I must be missing something. Anyway, if the stick is to the left, make the wheel speed decrease on the left set. Interpolate the values from full ahead to full backward:
(Joy.X - 250) / 250 for the left treads and
(750 - Joy.X) / 250 for the right treads.
When the joystick is to the left, the right wheels should move full speed ahead.
and vice versa for the other side.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Tank simulation question
Tank simulation question
Tank simulation question Tank simulation question
Tank simulation question
Tank simulation question
Tank simulation question Tank simulation question Tank simulation question Tank simulation question Tank simulation question Tank simulation question Tank simulation question
Tank simulation question
Tank simulation question
 
Tank simulation question
Tank simulation question
 
-->