From: Stuart T. <st...@vi...> - 2006-09-24 17:24:49
|
Yea, that's basically what I was doing: quat = gmtl::makeRot<gmtl::Quatf>(aa); vecnew = quat * vec; I just didn't know if there was something I was missing since it was in the FAQ (I'm not sure how up to date the FAQ is, but it's generally very useful for how to do common things with gmtl). Thanks, Stuart subatomic wrote: > it's possible this func isn't implemented yet... if you create an > implementation, send it along... > > It's also possible that the implementation was omitted since it could lull > people into writing inefficient code... > i.e. you'd need to encode that axis angle into something to xform the > vector > by anyway. > > > an example function you could write... > > /// pseudo code for axisangle * vec... > vec operator*(AA, Vec) > { > convert( quat, aa ) //< ( i haven't checked, but I think this one > exists...) > return quat * vec; > } > > > On 9/23/06, subatomic <ke...@su...> wrote: >> >> >> try reversing the order? >> >> On 9/23/06, Stuart Tett <st...@vi...> wrote: >> > >> > I got this from the GMTL FAQ: >> > >> > gmtl::Vec3f myVec; >> > gmtl::AxisAngle myAA; >> > gmtl::Quaternion myQuat; >> > >> > myVec = myVec * myAA; >> > myVec = myVec * myQuat; >> > >> > I first tried it with an gmtl::AxisAnglef, then a gmtl::Quatf. Neither >> > seem to have an operator* for multiplying a Vec by an AxisAngle >> > >> > I grep'd the src code to make sure. The only operator's I found were >> > for: >> > >> > VecBase<DATA_TYPE, 3> operator*( const Quat<DATA_TYPE>& rot, const >> > VecBase<DATA_TYPE, 3>& vector ) >> > >> > VecBase<DATA_TYPE, 3> operator*=(VecBase<DATA_TYPE, 3>& vector, const >> > Quat<DATA_TYPE>& rot) >> > >> > so you could do myVec = myQuat * myVec; >> > >> > But how could I rotate a vector by a AxisAngle? Do I just have to >> > convert it to a quaternion? >> > >> > Basically, I want to rotate a particle theta degrees around an >> arbitrary >> > axis. >> > >> > Thanks. >> > Stuart >> > >> > >> > >> ------------------------------------------------------------------------- >> > Take Surveys. Earn Cash. Influence the Future of IT >> > Join SourceForge.net's Techsay panel and you'll get the chance to share >> > your >> > opinions on IT & business topics through brief surveys -- and earn cash >> > >> > >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> > _______________________________________________ >> > ggt-devel mailing list >> > ggt...@li... >> > https://lists.sourceforge.net/lists/listinfo/ggt-devel >> > >> >> >> >> -- >> Kevin Meinert >> http://www.subatomicglue.com > > > > |