View Full Version : A Vehicle Simulation Project.
PhantomDesign 06-06-2003, 05:45 PM I didn't know anything about maxscript untill last night starting at 10:00. I've already started programming my new vehicle simulation script. Basically, you'll setup the vehicle's settings in the menu on the right of your screen (hit "3" and you'll know which menu I'm talking about). You'll set up things like vehicle dimesions, center of mass, slide traction, static traction, forward traction, suspension max/min height, wheel position & radius, etc....
Now current ones cost a lot of $$$, much more than I think they are worth. Reelmotion(www.reelmotion.com) costs $800 while Vehicle Simulator 1.5 (http://www.newplugins.com/) costs $600.
The purpose of this thread is to accept suggestions and bounce ideas off of people. Probably initallly the goal is to create the basics, including an interface and basic forumulas for various actions. Basically make the plugin work to the point where someone would MUCH rather use it than set up things using keyframes(and be more accurate than manual setup). I'll use actual physics forumals wherever possible, and be constantly updating the "subsitute" style formulas.
I want you to think of all sorts of features you may want. Basically act as anal customers.
Take a look at my website to see some cool cars also :)
P.S. Here's a freebie of some alternative universe physics: http://members.shaw.ca/psyc3d/cartoonlaw.html
|
|
Erka2
06-06-2003, 06:01 PM
What do u want from us?
I want to try your script to see what u have done, how can i do this?
PhantomDesign
06-06-2003, 06:29 PM
Right now I want there to create a list of requirements/capabilities for the project.
For example:
Wheels
RAdius
Width
Slide traction (traction when it looses grip in the left/right direction)
Max turn angle(front wheels)
Forward traction (for aceleration and braking)
Static traction (how much force is needed to make the car start to slide)
XYZ position
Or you could say something like "The wheels should still have traction even if they are 1 centimeter(1) above the ground."
Basically waht do you want this project to do?
Erka2
06-06-2003, 06:55 PM
I want to see at least physical engine(in action) that u want to use in your project + some basical interface...
Dave Black
06-06-2003, 07:09 PM
There is a VERY extensive thread on car-rigging that you may find usefull. Lot's of maxscript stuff, tricks, tips, etc.
Seriously, have a look:
http://www.cgtalk.com/showthread.php?s=&threadid=40382&highlight=discussion
Good luck!
-3DZ
:D
Tex3D
06-06-2003, 07:28 PM
I'd be happy to give you ideas.
Things like multiple wheel riggings... I.e...18 wheeler would be nice.
Also, Level of surface friction. I.e. go from dry to wet = hard friction to slippery.
Hows about a bounce control to "fake" the shock absorbers.
These are kinda lofty "requests" but they may inspire you or possibly give you ideas. I'd love to try it out when it's ready. You should get an email list of some people that'll work with it for you.
-Dave:beer:
You should definitely consider building on top of the Reactor real time physics base as a starting point. That way your vehicle simulation will interact with Max's now native dynamic system.
Probably a couple of things the vehicle simulator should have would be an accurate suspension system and the ability to collide with objects in the scene.
good luck
sam
Dave Black
06-06-2003, 08:02 PM
There are a few plugins available for vehicle simulations, though I've only been able to find one of 'em...
http://www.newplugins.com/About/
-3DZ
:D
Erka2
06-06-2003, 08:05 PM
He wrote those link in first post...
Dave Black
06-06-2003, 08:27 PM
Whoops! Sure did. And the worst thing, is that I actually read his whole post. Wow. This challenge has got me all scatter-brained.
My sincerest apologies.
Please continue, and forget I said a word!
:blush:
-3DZ
:D
PhantomDesign
06-06-2003, 08:43 PM
Erika2: I don't have anything to show quite yet. I started from scratch last night. I didn't know any max scripting until I started looking at the help file at 10:00. I went to bed at 12:45 because I had 3 finals today (summer school. Trying to finish up college 1 year early).
3DZealot:
The initial idea came from that thread except that a lot of that work won't be too useful in what I'm working on.
sam:
Reactor costs extra...and I don't have the cash right now. Also if I do not require reactor, chances are I'll have a larger market. Suspension system will be there, and as accurate as possible.
Tex3D:
I'll only work with a standard 4 wheel setup. (you can simulate 2 or 3 wheels by placing the left and right on the X=0 axis) Eventually you'll be able to instance wheels for any number of wheels (more likely version 3.0....way in the future).
I want to keep it simple at first, meaning that the collisions are restricted to the wheels and a single terrain object. Eventually I'll add other collisions, which will also let you set traction properties of various friction surfaces (you'll set the value to each "terrain" object you add to the scene).
The springs will act as shock absorbers, not merely bounce. I'm making it first usable, and then realistic; meaning eventually the usable function will be replaced with realistic functions. All useable functions will be useable as in it'll act like shock absorbers and only vary slightly from the real physical formula.
General....
At the moment I want to work on my own, mostly just looking for general feedback, and maybe a few tiny specific questions because that is how I work best. If you'd like to be part of the project, you can e-mail me (phantomcars@hotmail.com) and tell me how you think you can help the project and if or what you would like in return. Again I doubt I'll need much (if any) specific extensive help. If you "donate" useful code segments or ideas, I'll make sure to give you special consideration/credit.
Chances are I wont need any general beta testing. If people are adopted into the project or submit significant code/help, those people are the ones who are going to be part of beta testing. I have multiple specific reasons for not wanting mass beta testing.
I'll be posting short videos & pictures & description along the way to keep everyone updated. I'll probably be adding a section on my site called "Phantom Simulations" which will include this (unnamed) simulator. Oh, if you want to suggest names, I don't mind :)
LFShade
06-06-2003, 09:10 PM
Reactor is included in the latest versions of Max, so there should be no problems with developing for a broad user-base. I assume you must be using Max4, though, in which case it'll be impossible for you to develop for a plugin you don't have and can't test with.
I'm not so much of a math/physics genius, but I'd be happy ply my Maxscript skills on the project if you should so desire. Ultimately, it will be interesting to see how far a car simulation scheme can be advanced through script alone.
Let me know if there's any way I can help!
RH
PhantomDesign
06-07-2003, 06:25 AM
There's more to add to this descriptive part of the help file. You'll notice a few of the tutorials I'm planning at the bottom.
Yeah I have version 4 of Max, and should probably look into upgrading my licence to version 5.
If I make it very basic, I'll be able to do nearly anyting I want, and sell this to max 4 users, and possibly max 3 users.
I don't need direct help, but I'll keep you in mind.
---------
Phantom Simulation’s
XXXX(name)XXXXX
Jonathan Griffin © 2003
Note: Look at the definitions and important notes section.
Menu:
•About: Displays copyright information and short description
•Help: Displays help menu (this menu).
Main (Animation) Menu:
•Update: Update the position of all wheel and position controllers. In no controllers exist, new ones will be created.
•Select Terrain: Click this button then select the object to act as the ground.
•Animate: Runs the animation. Please read the tutorial and try out some of the sample files.
•Start: Set the frame where the calculations start.
•End: Set the frame where the calculations stop.
•Initial Positions: Set the initial [x,y,z] position and the [Pitch, Roll, Yaw] of the Center of Gravity. The wheels will resituate themselves relative to the CoG.
•Initial Velocities: Set the initial positional velocities and the rotational velocities of the main object (vehicle body). All values are relative to the CoG
Wheel Menu
•Radius: Radius of all four wheels
•Width: Width of all four wheels
•Track Width: Distance between left wheel and right wheel. This is also equal to 2*x where x=x-pos of any wheel
•Front Distance from CoG: Distance between the y-axis CoG and the y-pos of front wheels. This is also the y position front wheels.
•Rear Distance from CoG: Distance between the y-axis CoG and the y-axis position of rear wheels. This is also the negative y position rear wheels. (Positive number)
•Distance below CoG: This is the distance between the y-axis CoG and the wheel’s z-pos. This is also the wheel’s z-pos. (Can be negative)
•Static Traction: This is the amount of traction the tires have when the car is not sliding. This is also an indicator of how much lateral force is needed to overcome the tires grip on the ground. This is a multiplier. Other factors, such as the tire’s width and radius are considerations.
•Slide Traction: This is the amount of traction the tires have while the car is sliding (skidding). Like static traction, this is a multiplier.
•Turning angle: This is the maximum angle the front tires can turn.
•Traction distance: The maximum distance between the wheel and the ground that is permissible for traction. This mostly is used to prevent buggy loss of traction across non-flat surfaces.
Shocks
•Max compression: This is the maximum distance the shocks can compress. This is also the maximum distance the wheels will move upwards from their initial position.
•Spring Constant: This is nearly the amount of resistance the shocks have to compression.
•Bounce: This is the tendency the wheels have to bounce. Use lower values to dampen the effects.
Mass
•Total Mass: This is the total mass of the vehicle.
•Mass Pitch, Rool, and Yaw: This is physically determined by the distribution of mass relative to the CoG Large masses near the CoG (like mid-engined cars) reduce these values while large masses far away from the CoG (vehicles like Vans or SUVs) have much higher values.
•Pitch: The tendency for an object to pitch forward or backward when accelerating or braking.
•Roll: The tendency for an object to roll (left/right). Lower values are suggested for best handling while higher values would be good for simulating Vans or SUVs. Negative values are suggested for motorcycles.
•Yaw: The tendency for an object to resist turning like motion.
Important notes
•Look at the definition section, ideas section and tutorials for additional help!!!
• [x,y,z] indicates the position (or dimensions, or vector, or scalar) of an object where x=x position, y=y position and z=z position
•Center of Gravity or COG is at [0,0,0], and statements below make the assumption that this is true.
•Bold indicates the term or concept being described or defined.
•Underline indicates a numerical value, vector, position, or scalar.
•Italics indicate a definition or description.
•Wheel positions are described as the absolute center of a wheel. The radius of the wheel is defined from this point, and the width of the wheel is divided equally on each side of the center. (Example: The x-axis outside edge of the wheel=x-axis center of wheel + ½ * wheel width.
Definitions and Abbreviations
•CoG or Center of Gravity is the point where you could balance an object on.
•pos is an abbreviated form of position. Ex: y-pos means the y-axis position
•Track Width: Distance between the center of the left wheel tread and the center of the right wheel tread.
Ideas:
•Hovercraft physics can be imitated by setting the static traction to a very low value. For better results, also experiment with the shock settings. Unfortunately the propulsion system will be inaccurate.
•Flight can be obtained by setting the lift to a positive value. Realize that you have no propulsion when the wheels aren’t touching the ground. Notice that the pitch effect will cause the vehicle’s nose to move up or down while the vehicle is in the air.
•Motorcycle physics can be imitated by setting the Track Width to 0. For making the motorcycle not tip over and maneuver appropriately, use a low CoG and/or try negative values to make the vehicle tilt into turns (motorcycle physics).
•Tutorials included are very important to quickly and adequately learning this plug-in.
•The Dynamics Tutorial is included because this plug-in only detects collisions between the terrain object and the four wheels. The dynamics tutorial allows you to roll the vehicle or collide with other objects.
•Experiment with the example files to see how different settings affect the vehicle. Try substituting your own vehicles in place of the vehicles in the example files.
•Make Suggestions on how this plugin can improve and e-mail them to phantomcars@hotmail.com
Tutorials
Dynamics
Setup controllers to match your car. (initial position and pitch/roll/yaw).
Beginner Tutorial
Advanced tutorial
Aaron Moore
06-13-2003, 04:11 PM
(wow, first post in... 3 months? or more... I've been waaay out)
Anyway, just wanted to drop in and make a suggestion. The biggest problem with simulators, is that they either make it too complex, or the results are hard to control.
The link 3dzealot gave you to my thead should be of use to u.
How far have you gotten on your project? What kind of results are you getting at the moment with it?
Regards,
Aaron
PhantomDesign
06-14-2003, 08:48 AM
After some careful thouught about how the physics will work, I realised that I needed to create a lot of 3D functions to do things like...
1. Rotate one 3D angle by another 3D angle.
2. Rotate a 3D vector by a 3D angle.
3. Discover the magnitude of one vector relative to the direction another vector is pointing.
And a lot of physics functiosn relating to things like torque and traction and all other sorts of force related things.
I've written a ton of fully fiunctional mathematical fiunctions so far. I started easy by writing a simple program which you choose any 3 parts of a triange (3 sides and 3 angles=6 things to chose from). You input any 3 parts of the triangle (except 3 angles) and it gives you all six. It even takes into account cases where there are two posibilities.
The truth is this program was origionally written my my softmore year of highschool. I just graduated college with a mathematics degree, so that's what I mean by I started out very easy.
The triangle program isn't actually goign to be used while you would be running my software, but I'm using it to help me write other functions. My computer is like over 1000x faster than my calculator :)
----
O.K. About the simulator. Currently I have the forces summed up into 9 components. They are as follows:
4 wheels (where the tire meets the ground)
4 shocks (these forces are generally determined from the wheel position data and the 4 physics points mentioned above.)
1 CoG (Also know as Center of Gravity. This is where the majority of calculations end up taking their final effect. The wheels and shocks really have no mass, and are merely forces.
I don't want to say too much but I think I know exactly how I'll setup my colosion models very efficently. I just need a way of sampling the highest point (Z-axis) on any object by specifying the X and Y axis. These values ill be then used to create an entirely new hidden "object" for terrain(rather than being calculated on the fly).
CGTalk Moderation
01-15-2006, 08:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.