Definition of cardinal directions
by Isidoros · in Torque Game Engine · 01/12/2010 (10:59 am) · 3 replies
Studying the "Advanced 3D Game Programming All in One", I have noticed that the definition of cardinal directions is:
Can we use an alternative definition such as:
$cardinalDirection[0]="0 10000 0"; //N $cardinalDirection[1]="6000 6000 0"; //NE $cardinalDirection[2]="10000 0 0"; //E $cardinalDirection[3]="6000 -6000 0"; //SE
Can we use an alternative definition such as:
$cardinalDirection[0]="0 2000 0"; //N $cardinalDirection[1]="2000 2000 0"; //NE ....
About the author
Recent Threads
#2
01/12/2010 (2:10 pm)
Yes, it is used as arg in setAimLocation(). I can't find a reason not to use your definition.
#3
In answer to your original question, you can certainly use whatever vectors you like to define your compass points - as long as they're at the right angles to each other and so on.
01/12/2010 (7:20 pm)
If it's being used in setAimLocation, then you'd probably want to use the large-scaled vectors. Otherwise, all bots will aim at a spot within one metre of the world origin, whether you tell them to aim north, south, east or west.In answer to your original question, you can certainly use whatever vectors you like to define your compass points - as long as they're at the right angles to each other and so on.
Torque Owner Wes Macdonald
In the case they are vectors, I think both definitions are overly complicated. Something that is easier to see what's going on just by looking at it:
$cardinalDirection[0]=VectorNormalize("0 1 0"); //N $cardinalDirection[1]=VectorNormalize("1 1 0"); //NE $cardinalDirection[2]=VectorNormalize("1 0 0"); //E $cardinalDirection[3]=VectorNormalize("1 -1 0"); //SE