reset password
Author Message
venny
Posts: 61
Posted 11:58 May 27, 2016 |

While looking at the equation for a camera roll I saw 

• u’ = cos(α) u + sin(α) v 

v’ = -sin(α) u + cos(α) v

But when I looked at the code, it showed: 

Vector3 t(u); // remember old u

u.set(cs*t.x - sn*v.x, cs*t.y - sn*v.y, cs*t.z - sn*v.z);

v.set(sn*t.x + cs*v.x, sn*t.y + cs*v.y, sn*t.z + cs*v.z);

I thought the u' would use the equation of :  cs*t.x + sn*v.x 

It seems the u' is using the equation for v' 

wveit
Posts: 18
Posted 16:57 May 27, 2016 |

Hi, the first formula is correct. The code implementation looks like a typo. My roll function uses

u’ = cos(α) u + sin(α) v 

v’ = -sin(α) u + cos(α) v

and it works correctly.

Last edited by wveit at 16:58 May 27, 2016.