Hello Victor, Victor Haefner wrote: > I needed screenshots of my scene from the front, side, and top. It works, > need no help, just found something perhaps : > > //grab some filegrabforeground > > Vec3f from = navi->getFrom(); > Vec3f up = navi->getUp(); > > beginEditCP(grab); > grab->setActive(true); > endEditCP(grab); > > > navi->setFrom(Vec3f(0,1.25,7)); > navi->setUp(Vec3f(0,1,0)); > mgr->redraw(); > > navi->setFrom(Vec3f(7,1.25,0)); > navi->setUp(Vec3f(0,1,0)); > mgr->redraw(); > > navi->setUp(Vec3f(1,1,1)); > navi->setFrom(Vec3f(0,8.25,0)); > navi->setUp(Vec3f(0,0,1)); > mgr->redraw(); > > > beginEditCP(grab); > grab->setActive(false); > endEditCP(grab); > > navi->setUp(Vec3f(1,1,1)); > navi->setFrom(from); > navi->setUp(up); > > whithout the lines navi->setUp(Vec3f(1,1,1)); inbetween it could happen that > the navigator would not jump to the new location (happend for the last 2 > setFrom()) > > just thought I should tell someone.. I don't know if I did something > terribly wrong or not.. hope its usefull to someone..
I guess you leave "to" at (0,0,0)? Then choosing a "from" on the y axis essentially makes the y and z axis of the coordinate system that is constructed from "from", "to" and "up" coincide. That coordinate system has the z axis as ("from" - "to"), y axis as "up" and x axis as the cross product of the two, which requires the two to be linear independent. > I suspect there is some vector calculation in the background whitch doesnt > work when up x from = (0,0,0) yes, almost, it is "up" x ("from" - "to") = (0,0,0), but if "to" is the origin that is of course the same as "up" x "from" ;) We could probably check that the angle between "up" and ("from" - "to") is not too small and warn otherwise... Cheers, Carsten ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users