Scripts / Another quaternion example

Author
Message
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 22nd Jan 2018 21:32 Edited at: 22nd Jan 2018 23:08
Small example but could be useful to someone.

Simply attach the script to a bunch of entities and they will berotated to face the first one (the first one will rotate to face the second).

Strictly speaking you could do this as a static example with simple maths (or you would thinks so) especially if you only wanted rotation in one plane (like how decals work at present) but if you need a dynamically facing version with rotation in two or three planes then quaternions are the way to go.

I may return to the quaternion library at some time in the future to add SLERP, if anyone has a burning need for it let me know (if you don't know what it is then you probably don't have a burning need! ).
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Bolt Action Gaming
GameGuru Tool Maker
10
Years of Service
User Offline
Joined: 24th Oct 2013
Location: Harrisburg, PA (USA)
Posted: 24th Jan 2018 15:43
Thanks AmenMoses. I will try to test this tonight with respect to my original message to you.

Code like this is literally the only reason I regret not going to College before going to industry; I could have used the Calculus I/II/III coursework to help understand it better, rather than learning it as a hobbyist many years later.
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 24th Jan 2018 19:41
What's college? I'm completely self taught.

Been there, done that, got all the T-Shirts!
PM
Blacknyt46
8
Years of Service
User Offline
Joined: 29th Feb 2016
Location:
Posted: 25th Jan 2018 02:51
Self taught! That's awesome man!
Jim C

Login to post a reply

Server time is: 2024-04-24 16:23:13
Your offset time is: 2024-04-24 16:23:13