Reply
 
Thread Tools
Old 26-06-2004, 12:32 PM   #1   [permalink]
AchtungAffen
Forum Master
 
AchtungAffen's Avatar
 
Join Date: 4 Nov 2001
Location: Rei Liberation Parade
Posts: 3,977
Send a message via ICQ to AchtungAffen Send a message via MSN to AchtungAffen
Help! I suck at math! (VB related)

I'm making an app in VB but I discovered my limitations in vector algebra.

The thing is that I'm using VB to create an app where you move a 'guy' across a space. Ok, the first coordinates of the movement vector are the center of the screen, for 1024*768 its (512;384). The second coordinates of the vector are where the mouse points on the screen (its a full screen app).

So, with some help I could get the angle of that vector, considering that angle as 0 when X=0 and Y=-1 (X=512;Y<384).

So when you press the "W" key, the 'guy' moves upward on the map (it doesn't actually move, what moves is the background). I inverted the processes so when you press "S" the 'guy' moves opposite to that.

But now I'm trying it to go left and right ("A" and "D" key presses). So I need to get a normal vector (I think that was the name), wich means, a vector that compared to the original movement vector, makes a 90 deg angle. So if the angle of the movement vector is 0, this new vector (unitary) when pressing "A" should have the following coordinates: (X=-1; Y=0).

Well, I can't seem to do that. I suck at using sin and cos functions, I suck at math in general, and can't seem to make this work! BTW, I'm using VB to do this. So, if you understood what I wrote here, and know VB, could you lend me a hand, please?

Thx.
__________________
REI LIBERATION PARADE
Eva resources en espaņol
AchtungAffen is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Games you suck at, orochi X All Gaming forum 43 06-03-2003 04:35 AM
man!!! I suck I suck I suck I suck I suck!!!!!!! BigShot Jordan Anime Fan Art/Images 13 11-02-2001 10:10 PM


New To Site? Need Help?

All times are GMT -4. The time now is 02:19 PM.


Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2018, vBulletin Solutions, Inc.