From: Ryan A. <rya...@gm...> - 2011-06-23 16:16:29
|
> > Changing Viewer.Pos or Quat I think is like navigating with Walk or Fly - > the Viewer/avatar moves by Pos with respect to the currently bound > viewpoint, and is conceptually a child of the viewpoint. So that part should > be OK / legal / equivalent to navigation. > Is there an equivalent to Viewer.Pos for examine? Viewer.examine->Origin.x/y/z ? > When doing combinations of rotations and translations, the order of > operations is not 'commutative'. Let's say you're doing a translation then a > rotation. You could try the opposite order: rotation first, then > translation. > Ok, worth a shot. I'm setting them in RenderSceneUpdateScene which gets called on every render loop. Does just setting them like this in the render loop actually cause them to be set in the correct order? matrix_to_quaternion(&(Viewer.Quat), mat); Viewer.Pos.x = -mvX; Viewer.Pos.y = -mvY; Viewer.Pos.z = -mvZ; On Thu, Jun 23, 2011 at 11:46 AM, doug sanden <hig...@ho...>wrote: > Changing Viewer.Pos or Quat I think is like navigating with Walk or Fly - > the Viewer/avatar moves by Pos with respect to the currently bound > viewpoint, and is conceptually a child of the viewpoint. So that part should > be OK / legal / equivalent to navigation. > When doing combinations of rotations and translations, the order of > operations is not 'commutative'. Let's say you're doing a translation then a > rotation. You could try the opposite order: rotation first, then > translation. > > > > > I'm starting with a model view matrix which contains the orientation and > position. > > When I use the position values from the matrix Veiwer.Pos.x = mat[12], > Veiwer.Pos.y = mat[13], Veiwer.Pos.z = mat[14] the model positions > correctly, but the center of rotation seems to be off by the Z value. > > Once I add the orientation, things go wrong: > > I convert the matrix to Quat: matrix_to_quaternion(&(Viewer.Quat), mat); > > The problem is that the object goes off screen. My assumption is that this > is happening because the center of rotation is incorrect. > > The is the general overview of what I'm trying to do. I believe that if I > could keep the center of rotation to match the location of the object given > by the model view matrix that I might be successful. > > Thanks, > Ryan > > > > > > On Thu, Jun 23, 2011 at 10:50 AM, doug sanden <hig...@ho... > > wrote: > > Are you just rotating (like Examine) or are you also translating (either > the camera or object)? > > If just rotating, then keeping Dist=10, and carefully matching the > Viewer.Pos xyz to the angle of view/Viewer quaternion might work. For > example if you take (X=0,Y=0,Z=10) and rotate it with Viewer.Quaternion > you'll get an X,Y,Z. Then use that (or -) for Viewer.Pos. > > > > > Right now I'm loading a WRL from the web and there will always be one > object on screen. Those are the limitations I'm setting up. I'm making > this more as an object viewer than a world viewer. > > When freeWRL starts up with the default settings of the Viewer.Pos.z = 10 > and Viewer.Dist = 10, the rotation is around the object. > > Once I try to manipulate the Viewer.Pos and Viewer.Dist in MainLoop I can't > maintain the center of rotation within the object. > > On Thu, Jun 23, 2011 at 9:40 AM, doug sanden <hig...@ho...>wrote: > > > > > > > I'm looking to maintain the center of rotation inside the center of my > object as I move an object with Viewer.Pos.x/y/z inside > > MainLoop.c > RenderSceneUpdateScene > > How about a SphereSensor node? See tests/10.wrl. > > > > I'm not able to edit my WRL files that I'll be using. Will this still be > useful for me? > > No, or not in an easy way. > How do you know there will be an object in the scene, or which object in > the scene you want to rotate around? > > > > > > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > FreeWRL-develop mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Data protection magic? Nope - It's > vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > > _______________________________________________ FreeWRL-develop mailing > list Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > FreeWRL-develop mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with vRanger. > Installation's a snap, and flexible recovery options mean your data is safe, > secure and there when you need it. Data protection magic? Nope - It's > vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > > _______________________________________________ FreeWRL-develop mailing > list Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > > > ------------------------------------------------------------------------------ > Simplify data backup and recovery for your virtual environment with > vRanger. > Installation's a snap, and flexible recovery options mean your data is > safe, > secure and there when you need it. Data protection magic? > Nope - It's vRanger. Get your free trial download today. > http://p.sf.net/sfu/quest-sfdev2dev > _______________________________________________ > FreeWRL-develop mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freewrl-develop > > |