Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Position checking?
Position checking?
2003-01-10, 7:44 AM #1
I posted this before, aboud 3 years ago, and I got a good answer from Mohican... I don't expect he's still around, but maybe someone else remembers what I'm talking about. I actually implemented this in a cog and got it work, but I can't find that cog and the forums have been cleaned up since then [http://forums.massassi.net/html/frown.gif]

I want to check if a world position (a point vector) is to the left or to the right of the player's position (anopther point vector, if you will). I vaguely remember something like this... getting the cross product of the player's forward vector with <another vector>, and checking whether that vector's Z value is > 0.26 (don't ask me why).

Any help?
Dreams of a dreamer from afar to a fardreamer.
2003-01-10, 7:58 AM #2
Gethingrvec();
And when the moment is right, I'm gonna fly a kite.
2003-01-10, 8:00 AM #3
I beg your pardon? [http://forums.massassi.net/html/confused.gif]

And explain the math so I won't forget it this ime
Dreams of a dreamer from afar to a fardreamer.
2003-01-10, 8:11 AM #4
Frm the Datamaster:

Quote:
<font face="Verdana, Arial" size="2">
Returns a normalized lookvector looking to the right of the thing's real lookvector. Syntax:

lvec = GetThingRVec(thing);
</font>



On second though, hmm, maybe that wouldnt help you. Someone who is better with vector math should answer this. [http://forums.massassi.net/html/frown.gif]
And when the moment is right, I'm gonna fly a kite.
2003-01-10, 8:28 AM #5
No, that wouldn't help me much [http://forums.massassi.net/html/smile.gif]
Dreams of a dreamer from afar to a fardreamer.
2003-01-10, 11:16 AM #6
Did you see this:

http://forums.massassi.net/html/Forum4/HTML/002089.html

Its an old post of yours. It looks like you figured out HOW to do it, but you just didnt understand why it worked.
- Wisdom is 99% experience, 1% knowledge. -
2003-01-10, 11:41 AM #7
RAAHAA! Thank you! I've been searching for it for the whole day! It never occured to me to search for my own posts, though [http://forums.massassi.net/html/smile.gif]

Thanks!
Dreams of a dreamer from afar to a fardreamer.
2003-01-10, 12:20 PM #8
Code:
symbols
message    startup
message    pulse
vector     pos
flex       dummy
end

Startup:
   SetPulse(.5);
   Return();

Pulse:
   dummy = VectorX(GetThingPos(GetLocalPlayerThing())) - VectorX(pos);
   If(dummy > 0) Print("left of pos");
   Else Print("right of pos");
   Return();
end

this level cog only relates, if your looking down from above. ie only based on the X axis.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2003-01-10, 12:54 PM #9
No, that will work only along the global x axis. If I look along the x (1, 0, 0) standing at (0, 0, 0) then I could have points that are directly in front or behind me but according to your math they'd be on my left/right: (-0.5, 0, 0) and (1.2, 0, 0) for example.

Check yer math [http://forums.massassi.net/html/smile.gif]
Dreams of a dreamer from afar to a fardreamer.

↑ Up to the top!