<div dir="ltr"><div><div>Hi all,<br><br></div> I think there is a bug in vtkQuaternion<T>::SetRotationAngleAndAxis. What if I want to<br>set angle=1.0 and xyz=(0, 0, 0)? I need an identity matrix from this quaternion. Should it call this->Set(1.0, 0.0, 0.0, 0.0) instead of this->Set(0.0, 0.0, 0.0, 0.0) in this case?<br>
<br></div><div>Thanks,<br></div><div>Mengda<br></div><div><br><br><br></div>The code is pasted here:<br><div><br>template<typename T> void<br>vtkQuaternion<T>::SetRotationAngleAndAxis (const T& angle,<br> const T& x,<br>
const T& y,<br> const T& z)<br>{<br> T axisNorm = x*x + y*y + z*z;<br> if (axisNorm != 0.0)<br> {<br> T w = cos(angle / 2.0);<br>
this->SetW(w);<br><br> T f = sin( angle / 2.0);<br> this->SetX((x / axisNorm) * f);<br> this->SetY((y / axisNorm) * f);<br> this->SetZ((z / axisNorm) * f);<br> }<br> else<br> {<br> this->Set(0.0, 0.0, 0.0, 0.0);<br>
}<br>}<br></div></div>