![]() |
【转帖】odgsbasevectorizeviewpolylineout coordinates
odgsbasevectorizeview::polylineout coordinates
odgsbasevectorizeview::polylineout coordinates hi, in what coordinates are coded the input points in the odgsbasevectorizeview:olylineout() function (actually overridable in a odgsbasevectorizeview class)? why they are dependent by the current view settings? is there a way to force it to input world coordinates only? currently i crack this by calling m_pmodeltoeyeproc->setworldtoeyetransform(odgematrix3d::kidentity) ; in each myview::draw(const odgidrawable* pdrawable) call. thanks in advance for any help. regards chudomir hi chudomir, you can control output coordinates via odgibasevectoriser::seteyetooutputtransform(). however in your case you just need to get identity world-to-eye-transform. it is set to identity in odgsbasevectorizeview's constructor and is controlled by odgsbasevectorizeview's::setview(); setview(odgepoint3d::korigin - odgevector3d::kzaxis, odgepoint3d::korigin, odgevector3d::kyaxis, fieldwidth, fieldheight, odgsview::kparallel) will set it to identity. fieldwidth, fieldheight affect projection that is not used in common case (on odgsbasevectorizeview level), odgsbasevectorizeview::getnumpixelsinunitsquare() that is used for deviation calculation. m_pmodeltoeyeproc->setworldtoeyetransform(odgematrix3d::kidentity) ; is probably the shortest way and i don't see any problem you to use it. last edited by dmitry a. novikov; 18th may 2004 at 06:27 amfff">. >>currently i crack this by calling >>m_pmodeltoeyeproc->setworldtoeyetransform(odgematrix3d::kidentity) ; hi cudomir, seems this is the better way: // add eye-to-world transform to get geometry in wcs seteyetooutputtransform(getworldtoeyetransform().i nverse()); // restore world-to-eye transform seteyetooutputtransform(odgematrix3d::kidentity); thank you for your reply, but where should i call it and restore it? i call m_pmodeltoeyeproc->setworldtoeyetransform(odgematrix3d::kidentity) ; in the draw() member function, and all seems to work? regards chudomir it probably depends... i do the next to build solid cache on each view: code: void exgsopenglvectviewworldcache::update() { // temporary caching implementation: odgematrix3d xw2e = getworldtoeyetransform(); ::glmatrixmode( gl_modelview ); ::glloadmatrixd((const gldouble*)&xw2e.transpose()); if(!m_list) { m_list = ::glgenlists(1); invalidate(); } if(!m_blistvalid) { ::glnewlist(m_list, gl_compile_and_execute); seteyetooutputtransform(xw2e.inverse()); exgsopenglvectorizeview::update(); // restore world-to-eye transform seteyetooutputtransform(odgematrix3d::kidentity); ::glendlist(); // set to valid only if fully regenerated m_blistvalid = !regenabort(); } else { ::glcalllist(m_list); } ::glmatrixmode( gl_modelview ); ::glloadidentity(); } i see. well, in our system we use openinventor - it have a camera object and we have to fill the geometry in world coordinates. the camera takes care for the output. thanks for your help anyway regards chudomir |
所有的时间均为北京时间。 现在的时间是 12:25 AM. |