| 09-03-2006, 07:39 PM | #2 |
Extremely useful. Thanks a lot for making this for everyone to use! Just looked it over, and it even has TerrainNormal, that's smooth :) Had lot's of fun watching the bouncy ball forever and ever. Well, until it's always growing momentum med it bounce itself out of existance, dunno where it went. At one point it slid along the ground, painting it with 100+ bounce art effect. But in general, very smooth. |
| 09-03-2006, 09:11 PM | #3 |
Finally you submit this! The demonstration is beautiful. Approved. Constant accelerations produces parabolas. That very simple integration method will always increase or decrease energy since it can only exactly reproduce lines. If you flip the order of adding velocity/acceleration to position/velocity you'll see it decay instead of grow. Since the solution is exactly a parabola you can use an explicit formula. But if you want to be generic to non constant acceleration you can get the same exact integration of constant acceleration with a tiny bit more complexity: JASS:local integer k1v //unoptimized Runge Kutta 2 local integer k1x //Takes a trial half sized step local integer k2v //computes derivatives in middle of interval local integer k2x //uses those values to step from beginning to end set k1v = VectorAmplify(vectors[4],BouncyPeriod()*.5) set k1x = VectorAmplify(vectors[3],BouncyPeriod()*.5) set k2v = VectorAmplify(vectors[4],BouncyPeriod()) //recompute acceleration if it's time or position dependent set k2x = VectorSum(k1v,vectors[3]) call VectorScale(k2x,BouncyPeriod()) call VectorAdd(vectors[2],k2x) call VectorAdd(vectors[3],k2v) call VectorDestroy(k1v) call VectorDestroy(k1x) call VectorDestroy(k2v) call VectorDestroy(k2x) In general for spells the lack of conservation in the simple integrator is not a problem, but it will become one as you increase the time step. .01 is smaller than what is necessary for visually smooth. With this integrator you can safely increase to a less aggressive .03-.05. |
| 09-04-2006, 06:27 AM | #4 | |||
Quote:
Quote:
Quote:
But in the end, it's up to the users to decide how to utilize these functions, for simple projectile parabola approximations or more detailed and complex physical models. |
| 09-04-2006, 10:55 AM | #5 |
Anitarf - cool =) as for me your map (on the contest) was the best (after my XGM-Soccer ;) ) real nice physic but have some problems with camera + how i remember you have a constant vector for "pushing" it was 0 degree... or not i don't remeber you must make it more terrain orintainted and not constant ! PS the only real sys what i respect... because of usage of GetLocationZ(). my TPC use it for Z correction. Anitarf - i all ready use it in my TPC =) for create more reallystic "bounces" but really the hole sys is to simple (i mean your example) but it's not areal problem + the performance is great ! PS the best system which i have ever seen ! (non my sys =) ) +10000 rep :D !!! |
| 11-11-2006, 03:57 PM | #6 |
Anitarf, let me introduce Toadcop. He made a system, Toadcop's projectile creator. I don't feel like searching for it, I remember seeing a link at Infrane's PS. And his system allows to create dynamically moving projectiles with effects such as bounce, and other stuff... I must admit that your sys is easier than TPC, I will not judge is it better, but it's easier. Toadcop, anytime you need help with english, drop me a PM. |
| 11-11-2006, 07:20 PM | #7 |
This system is not made for moving objects dynamically. This is for is using mathematical vectors, the demo map just has a moving ball to demonstrate the use. While this system is VERY usefull it is not a dynamically moving system on its own. My system uses these functions to calculate stuff. |
| 11-21-2006, 11:48 AM | #8 |
iNfraNe, I see, but I said it about geometrical base of these systems. |
| 12-20-2006, 04:04 AM | #9 |
ArchWorm look a poopie! I noticed that by VECTOR he means SCALAR. A vector is a magnitude and direction combined, whilst a scalar is simply magnitude. For clarity, what he is doing is creating an x,y,Ø vector, and a 'z' scalar (for height). I will be releasing one of this humdingers not to compete with this one, but simply to polish up my math skills. GJ on this system I love the idea. Ø = Theta (angle) Edit: When going through it I was so confused how he incorporated height with vectors, but now I see they are just scalars. Edit: Oops sorry, I see the vectors now. This point has just been proven useless 'hoorah' |
| 12-20-2006, 09:46 AM | #10 |
A vector is not a magnitude and direction, it's something you can add with other vectors and scale. E.g., the real number line is a vector space, but the vectors have only one component. The scalars are the things you scale the vectors with, they can be either real or complex numbers. This package implements a three dimensional real vector space. All three components are part of the vector, but "x","y" and "z" are scalars, as they prescribe how much unit vector to scale and add to the mix. The vectors this system implements can be represented as magnitude and direction. For these two concepts you need a little more structure than the addition/scaling a vector space gives you. Once you add a dot product that maps two vectors to a scalar you can measure lengths and angles and think about a magnitude/direction representation. In practice you don't use that for actual computations since it's a nightmarish mess. |
| 12-20-2006, 10:21 AM | #11 |
I don't even know why I bothered doubting him lol, I should have automatically known he was right. ------------------------------------------------------------------------------------------------------------------------ I haven't gotten around to learning anything 3D in mathematics or physics (I'm in grade 12, and I take AP Calculus -- basically means 1st year university calculus), my knowledge in the area of this is very scarce, and would appreciate learning. I've figured out a rough outline using a pen and paper on how this goes about working, but I would appreciate it if you or Anitarf could PM me a simple but thorough explanation of everything that is going on in this system. I could try to talk to Anitarf sometime on BNet but things like this intrigue me and I'd like to learn more. PS. Until then I'm going to be thoroughly looking through the map getting a better understanding of it - something I should be learning in school but hey! school sucks and doesn't teach you jack. Edit: Oh shit double-post, I'll fix this. ______________________________________________________________________________________ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ JASS:function BouncyBallCreate takes nothing returns nothing local integer array vectors local timer t set udg_BouncyBall = CreateUnit(Player(0), 'ewsp', 0.0,0.0,0.0) // make it possible to change the unit's flyheight call UnitAddAbility(udg_BouncyBall, 'Amrf') call UnitRemoveAbility(udg_BouncyBall, 'Amrf') // create the unit's position vector set vectors[1]=VectorCreate(0.0,0.0,100.0) // create the unit's starting speed vector set vectors[2]=VectorCreate(GetRandomReal(-100.0, 100.0)*BouncyPeriod(),GetRandomReal(-100.0, 100.0)*BouncyPeriod(),500.0*BouncyPeriod()) // create the gravity acceleration vector set vectors[3]=VectorCreate(0.0, 0.0, -800.0*BouncyPeriod()*BouncyPeriod()) // to avoid having too many variables, we store these vectors into another vector set vectors[4]=VectorCreate(I2R(vectors[1]), I2R(vectors[2]), I2R(vectors[3])) call SetUnitUserData(udg_BouncyBall, vectors[4]) set t = CreateTimer() call TimerStart(t, BouncyPeriod(), true, function BouncyBallMove ) endfunction In your fourth vector creation, what do you convert the values to integers for? Also, more specifically than before: In your setting of vectors[1] you give the 'z' a value of 100.00. Later, in vectors[2], you create ANOTHER vector, equal to 5. Then, again, in vectors[3], you add an acceleration of gravity. I'm completely lost as to what you are doing here. |
| 12-21-2006, 03:32 PM | #12 |
Actually, the 4th vector is being used as a storing method for the other 3. The beauty of this system is that it can link 3 reals to 1 integer. So what the 4th does is link the other 3 vectors to it, so they can be selected trough 1 integer. It actually, unlike the other 3, has nothing mathematical about it. on an offtopic note: your signature function would crash the WE since its lacking a return statement. |
| 12-21-2006, 09:36 PM | #13 |
What you were looking at is the initialization function. It just creates the three basic vectors that the bouncy ball needs: one to determine it's position, what's it's offset from the origin of the map; another to determine it's speed, how much does it move in one time unit; another to determine it's acceleration, how much does the speed change in one time unit. The fourth one has nothing to do with physics but is used as a data structure. Under it's "coordinates" it stores the IDs of the before mentioned 3 vectors. Then you have a periodic timer that calls the function that moves the ball every time unit. |
| 12-25-2006, 07:53 AM | #14 |
this system totally owns :D |
| 12-25-2006, 03:34 PM | #15 |
So I guess you need to know JASS to use it? |
