Thread: Vector
View Single Post
Old 12-20-2006, 10:21 AM   #11
Join Date: Oct 2006
Posts: 858

xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)xombie has a spectacular aura about (79)


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.


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.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Collapse 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 )
After taking a look at your VectorCreate() function, it seems that you create 4 different vectors, and the 4th one is simply a clone of the first three. Would this not create DOUBLE the vector that you originally intended?

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.
xombie is offline   Reply With Quote