Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add linear interpolation (LERP) for quats #852

Merged
merged 1 commit into from
Nov 26, 2015
Merged

Add linear interpolation (LERP) for quats #852

merged 1 commit into from
Nov 26, 2015

Conversation

Kamilczak020
Copy link
Contributor

Introducing Quaternion LERP as there is SLERP already. No need for NLERP since its just LERP result normalized. Haven't done e2helper desc yet.

Introducing Quaternion LERP as there is SLERP already. No need for NLERP since its just LERP result normalized. Haven't done e2helper desc yet.
@TomyLobo
Copy link
Contributor

TomyLobo commented Mar 5, 2015

what is LERP needed for?

@Divran
Copy link
Contributor

Divran commented Mar 5, 2015

If I understand it correctly, slerp speeds up, reaches a max speed, and then slows down again. Lerp, on the other hand, rotates/moves stuff at a constant speed. Could be wrong tho

@TomyLobo
Copy link
Contributor

TomyLobo commented Mar 6, 2015

slerp is spherical linear interpolation. it's linear on a sphere.
In other words, if anything, it's the other way round.

But I was asking @Kamilczak020 :)

@Divran
Copy link
Contributor

Divran commented Mar 6, 2015

but I've used slerp in gmod many times and it does speed up, and then slow down, if provided with a constant multiplier. You have to use an equation to change the multiplier a lot to get it to be the same speed throughout the whole rotation. So therefore I just assumed that lerp must be constant speed, otherwise it wouldn't make much sense to have both

@thegrb93
Copy link
Contributor

thegrb93 commented Mar 6, 2015

From wikipedia

When Slerp is applied to unit quaternions, the quaternion path maps to a path through 3D rotations in a standard way. The effect is a rotation with uniform angular velocity around a fixed rotation axis

@Divran
Copy link
Contributor

Divran commented Mar 6, 2015

In that case, slerp is implemented incorrectly.

@TomyLobo
Copy link
Contributor

TomyLobo commented Mar 6, 2015

then it should be fixed.

...so the question still stands: what is LERP used for?

@AbigailBuccaneer
Copy link
Contributor

http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/ This is a good article that gives more info about slerp and similar. (Formatting's a bit broken though.)

@TomyLobo
Copy link
Contributor

TomyLobo commented Mar 7, 2015

that article lists slerp, nlerp and log-quaternion lerp.
I'm missing the logs in this log-quaternion lerp

nlerp is noted mostly for its performance where constant velocity is not important.
log-quaternion lerp seems to be the interpolation of choice if you need a commutative constant-velocity interpolation

It seems commutative here means that you can stack the NLERPs and LQLERPs (but not SLERPs) in whatever order you want

@TomyLobo
Copy link
Contributor

TomyLobo commented Mar 7, 2015

In conclusion, let's have slerp, nlerp and lqlerp functions and let's a have a table on the wiki comparing the three.

Having lerp might cause people to use that and wonder why those stupid useless quaternions are broken and useless

@oldmud0
Copy link

oldmud0 commented Nov 25, 2015

Merge?

@AbigailBuccaneer
Copy link
Contributor

This needs an E2Helper description, and I won't be home tonight. Happy for this to be merged if somebody can immediately follow it up with adding the description.

@AbigailBuccaneer
Copy link
Contributor

(If anybody's curious about the implementation, I was looking up a reference implementation and ended up here, where the code seems to have been translated from.)

@AbigailBuccaneer AbigailBuccaneer merged commit ce2a81e into wiremod:master Nov 26, 2015
@oldmud0
Copy link

oldmud0 commented Nov 26, 2015

I should read up on quats one day.

@TomyLobo TomyLobo mentioned this pull request Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants