Raised This Month: $32 Target: $400
 8% 

[SOLVED]Rotate point around vector?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-24-2014 , 18:45   [SOLVED]Rotate point around vector?
Reply With Quote #1

I have 2 points origins(P1 and P2) and a third point(P3) that is at distance N from P2. Now what i want to make is to rotate P3 around P2 at N distance by M angles. Made a lot of researches and searches but didn't understand so much because of my lack of maths ;s if anyone around knows an answer then thank you.

Some useful info? http://ami.ektf.hu/uploads/papers/fi...om175to186.pdf
Attached Thumbnails
Click image for larger version

Name:	lol.png
Views:	345
Size:	5.7 KB
ID:	139111  
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 10-26-2014 at 16:42.
Alka is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 10-24-2014 , 19:44   Re: Rotate point around vector?
Reply With Quote #2

Are we sticking to the example which is 2d, or do you need a 3d solution?

EDIT:
Oh dear, I didn't see the z-axis in the graph, yet wondered why the circle was so skewed.

You're going to have to define a rotation matrix, subtract p2 from p3, rotate it by multiplying it with the matrix, then readd p2.
And yes, the pdf is what you need.
Any specific issues we might help you with?
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 10-24-2014 at 19:54.
Dr. Greg House is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-25-2014 , 01:53   Re: Rotate point around vector?
Reply With Quote #3

EDIT: Solution found, there was a mistake, where rotation[0][3] / [1][3] / [2][3] was initially 0 because vector supposed to start from (0,0,0). Replaced those with last column from rotation matrix

where a,b,c = P1 and now works as intended. Also angle conversion wasn't needed.
I'll leave code here in case someone will eventually need this somewhere? Thank you for your suggestion Greg

Spoiler
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 10-26-2014 at 16:44.
Alka is offline
Reply



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


All times are GMT -4. The time now is 21:49.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode