hi:group
    how to set texture coordinates  in osg shader?
    I want to set texture coordinates to gl_Coordinates[0],how can I? thanks!







At 2014-10-07 09:14:55, [email protected] wrote:
>Send osg-users mailing list submissions to
>       [email protected]
>
>To subscribe or unsubscribe via the World Wide Web, visit
>       
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>or, via email, send a message with subject or body 'help' to
>       [email protected]
>
>You can reach the person managing the list at
>       [email protected]
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of osg-users digest..."
>
>
>Today's Topics:
>
>   1. Re: How do I adapt the osgViewer::Viewer in order to     have my
>      model in fullscreen mode? (Filipe P)
>   2. Re: LineSegmentIntersector bug? (weijianggood)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Tue, 07 Oct 2014 00:24:17 +0200
>From: "Filipe P" <[email protected]>
>To: [email protected]
>Subject: Re: [osg-users] How do I adapt the osgViewer::Viewer in order
>       to      have my model in fullscreen mode?
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset=UTF-8
>
>Hi Robert,
>thanks for your reply.
>
>I guess it should be the setUpViewOnSingleScreen() call.
>Unfortunately, the result was the same.
>
>Could you please give me an example or hints that demonstrate a fullscreen 
>model or image?
>
>Taking this problem, all the evaluation that I'm doing with OSG is going very 
>well.
>I'm happy with the performance of this scene graph.
>
>Thanks in advanced.
>
>Best regards,
>Filipe
>
>------------------
>Read this topic online here:
>http://forum.openscenegraph.org/viewtopic.php?p=61255#61255
>
>
>
>
>
>
>
>------------------------------
>
>Message: 2
>Date: Tue, 7 Oct 2014 09:15:28 +0800
>From: weijianggood <[email protected]>
>To: osg-users <[email protected]>
>Subject: Re: [osg-users] LineSegmentIntersector bug?
>Message-ID: <[email protected]>
>Content-Type: text/plain; charset="utf-8"
>
>Hello, Robert,
>
>Thank you for the suggestion.
>Currently, I am using osg3.0.1, intersector does not have the function 
>"setPrecisionHint".
>So I download the newest  version of osg from svn, then compile it.
>
>Finally,
>I add  the following line into my test code:
>intersector->setPrecisionHint(osgUtil::Intersector::PrecisionHint::USE_DOUBLE_CALCULATIONS);
> 
>It worked. Woooooo!  
>Thanks again.
>
>Rubby
>
>
>
>
>
>
>
>
>From: Robert Osfield
>Date: 2014-10-06 16:22
>To: OpenSceneGraph Users
>Subject: Re: [osg-users] LineSegmentIntersector bug?
>HI ? Could you sign your post so we know how to address you :-)
>
>
>From the description of the problem it looks likely to be a precision issue 
>where the line segment aligns right along the edge between two triangles with 
>neither triangle passing the test.
>
>
>In the svn/trunk version of the OSG there is a 
>IntersectionVisitor::setPrecisionHint(PrecisionHint hint) method that you can 
>use to hint to the intersectors to use double maths.  The 
>LineSegmentIntersector supports this.
>
>
>Could you try this out to see if it helps?
>
>Robert.
>
>
>
>On 5 October 2014 09:51, weijianggood <[email protected]> wrote:
>
>
>Hi,
>When i use LineSegmentIntersector in the following code.
>there must be 8 lines. but after I run the code, only 7 lines exist.
>
>
>
>int main( int argc, char** argv ){
>
>        float height = 5.f;
>
>        osg::ref_ptr<osg::TessellationHints> hints;
>        hints = new osg::TessellationHints;        
>        hints->setDetailRatio(0.5f);
>        hints->setCreateBody(true);
>        hints->setCreateBottom(false);
>        hints->setCreateTop(false);
>        osg::ref_ptr<osg::Geode> mynode = new osg::Geode;
>        osg::ref_ptr<osg::ShapeDrawable> drawable = new osg::ShapeDrawable(new 
> osg::Cylinder(osg::Vec3(0.0f,0.0f,0.0f),1.0f,height),hints);
>        osg::ref_ptr<osg::ShapeDrawable> drawable2 = new 
> osg::ShapeDrawable(new 
> osg::Cylinder(osg::Vec3(0.0f,0.0f,0.0f),4.0f,height),hints);
>        mynode->addDrawable(drawable.get());        // geom.get() or gemo. 
> both are ok. 
>        mynode->addDrawable(drawable2.get());
>
>        osg::ref_ptr<osg::Group> root = new osg::Group;
>        root->addChild(mynode.get() );
>        float angle = 0.0;
>        float angleDelta = 2.0f*osg::PI/8;        
>
>        for(int i=0; i<8;i++){  
>                float c = cosf(angle);
>                float s = sinf(angle);
>                osg::ref_ptr<osgUtil::LineSegmentIntersector> intersector = 
> new osgUtil::LineSegmentIntersector( osg::Vec3(0.0f,0.0f,0.0f),  
> osg::Vec3(10.0f*c,10.0f*s,0.0f) );
>
>                osgUtil::IntersectionVisitor iv( intersector.get() );
>                mynode->accept( iv );
>
>                if ( intersector->containsIntersections() )
>                {
>                        osgUtil::LineSegmentIntersector::Intersections
>                                &intersections = 
> intersector->getIntersections();
>                        std::cout <<"intersection size 
> "<<intersections.size()<<std::endl;
>
>                        osg::ref_ptr<osg::Geode>  geode=new osg::Geode;
>                        osg::ref_ptr<osg::Geometry> geom=new osg::Geometry;
>                        osg::ref_ptr<osg::Vec3Array> v3a=new osg::Vec3Array;
>                        osg::ref_ptr<osg::Vec4Array> colors = new 
> osg::Vec4Array;
>                        colors->push_back( osg::Vec4(1.0, 0.0, 0.0, 1.0) );
>
>                        
> osgUtil::LineSegmentIntersector::Intersections::iterator itr;
>                        for ( itr = intersections.begin(); itr != 
> intersections.end(); ++itr )                         {
>                                std::cout <<" X" << 
> itr->getWorldIntersectPoint().x()
>                                        << " Y" <<  
> itr->getWorldIntersectPoint().y()
>                                        << " Z" << 
> itr->getWorldIntersectPoint().z();
>                                if(itr == intersections.begin())
>                                        v3a->push_back( 
> itr->getWorldIntersectPoint());
>                                
>                        }
>                                itr--;
>                                v3a->push_back( itr->getWorldIntersectPoint());
>                        std::cout<<std::endl;
>                        geom->setVertexArray(v3a);
>                        geom->setColorArray(colors.get() );
>                        geom->setColorBinding(osg::Geometry::BIND_OVERALL);
>                        for(int k=0; k<v3a->size(); k++){
>                                std::cout<<"vectex: "<<v3a->at(k).x()<<" 
> "<<v3a->at(k).y()<<" "<<v3a->at(k).z();
>                        }
>                        std::cout<<std::endl;
>                        geom->addPrimitiveSet(new 
> osg::DrawArrays(osg::PrimitiveSet::LINES,0,v3a->size()));
>                        geode->addDrawable(geom);
>                        root->addChild(geode);
>                }else{
>                        std::cout<<"no intersection for i="<<i<<std::endl;
>                        std::cout<<"x "<<intersector->getStart().x()<<" y 
> "<<intersector->getStart().y()<<" z "<<intersector->getStart().z()<<std::endl;
>                        std::cout<<"x "<<intersector->getEnd().x()<<" y 
> "<<intersector->getEnd().y()<<" z "<<intersector->getEnd().z()<<std::endl;
>                }
>                angle+=angleDelta;
>        }
>        osgViewer::Viewer viewer;
>        viewer.setSceneData(root.get());
>        viewer.addEventHandler(new osgViewer::WindowSizeHandler);
>        return viewer.run();
>
>}
>
>Thanks.
>
>
>
>
>
>
>_______________________________________________
>osg-users mailing list
>[email protected]
>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>-------------- next part --------------
>An HTML attachment was scrubbed...
>URL: 
><http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20141007/5ac78a5e/attachment.htm>
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: not available
>Type: image/jpeg
>Size: 64310 bytes
>Desc: not available
>URL: 
><http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20141007/5ac78a5e/attachment.jpeg>
>
>------------------------------
>
>Subject: Digest Footer
>
>_______________________________________________
>osg-users mailing list
>[email protected]
>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>------------------------------
>
>End of osg-users Digest, Vol 88, Issue 7
>****************************************
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to