Re: [osg-users] Draw a triangle with front and back faces

2009-03-18 Thread Ruqin Zhang
ess, it's not seeing the > wood from the trees. Answer the question I asked, is it back face culling > that you are talking about?? In your OpenGL app did you enable/disable back > face culling? > > Robert. > > > 2009/3/18 Ruqin Zhang > >>

Re: [osg-users] Draw a triangle with front and back faces

2009-03-18 Thread Ruqin Zhang
't work. Any problem or mistake? Thanks a lot! Ruqin 2009/3/18 Robert Osfield > Hi Ruqin, > > 2009/3/18 Ruqin Zhang > >> Thanks Robert. Alright, here is the deal. I'm trying to draw a 3D >> triangular mesh with osg. For some mesh, the calculated normal points &

Re: [osg-users] Draw a triangle with front and back faces

2009-03-18 Thread Ruqin Zhang
ing for two sided lighting? > > Robert. > > 2009/3/18 Ruqin Zhang > >> Hi, >> >> I am trying to draw a triangle with filled front and back faces. In this >> way, >> even the normal of it has a wrong direction, I can still have it rendered >> correctl

[osg-users] Draw a triangle with front and back faces

2009-03-17 Thread Ruqin Zhang
Hi, I am trying to draw a triangle with filled front and back faces. In this way, even the normal of it has a wrong direction, I can still have it rendered correctly. I know how to do this in OpenGL, while didn't figure it out in OSG. Has anyone done this before? Please help me out with some sampl

[osg-users] Draw shaded polygons(filled) and wireframe for an object

2009-03-14 Thread Ruqin Zhang
Hi there, Does anyone know how to use polygon offset to *draw* shaded polygons together with related *wireframe* counterpart for an object without ugly visual artifacts ("stitching") in OSG? I want to set different colors for shaded polygons and the wireframe. Can anyone give me a simple example?

Re: [osg-users] Dragger rendering issue

2009-02-13 Thread Ruqin Zhang
> draggers are activated by pressing 'w' 'e' 'r' respectively, and view > rotation is enabled by holding down alt key. My objective in the project was > to create an interface similar to my favourite 3D modelling pakage... Maya. > Chris. > >

Re: [osg-users] How to set up two identical cameras?

2009-02-12 Thread Ruqin Zhang
2009 at 1:03 PM, Robert Osfield wrote: > Hi Raqin, > > I'm afraid I just don't understand the what you are trying to do and > why. I'm just getting more confused. Perhaps others can spot what > you are trying to do and how to do it. > > Robert. > >

Re: [osg-users] How to set up two identical cameras?

2009-02-12 Thread Ruqin Zhang
dragger and not cameras? It looks > lie the cameras are doing just fine to me. > > Robert. > > On Thu, Feb 12, 2009 at 4:52 PM, Ruqin Zhang wrote: > > Thanks Robert, > > > > Here is the setup: > > > > (1) For viewer and master camera: > >

[osg-users] How to set up two identical cameras?

2009-02-11 Thread Ruqin Zhang
Hi guys, I got a problem to set up two identical cameras. One is the master camera of osgViewer which contains the main scene. The other works as a slave of osgViewer which contains dragger. This is an effort of trying to force a post rendering of the dragger. Whiles, I got some issues here: I add

[osg-users] Triangular mesh with OSG

2009-02-04 Thread Ruqin Zhang
Hi there, Here, I got a question about drawing 3D mesh with OSG. I have the following information available: (1) number of vertices (2) position of each vertex (3) number of triangular faces (4) indexes for vertices involved in each triangular face I can draw each single triangular face as an os

Re: [osg-users] Dragger rendering issue

2009-01-27 Thread Ruqin Zhang
graph, so might be worth trying any > other ideas first. > But I can give you some code snippets if you want to try it. > Chris. > > - Original Message - From: Ruqin Zhang > To: Chris Denham ; osg-users@lists.openscenegraph.org > Sent: Tuesday, January 27, 2009 4:45

Re: [osg-users] Dragger rendering issue

2009-01-27 Thread Ruqin Zhang
other ideas first. > But I can give you some code snippets if you want to try it. > Chris. > > - Original Message - From: Ruqin Zhang > To: Chris Denham ; osg-users@lists.openscenegraph.org > Sent: Tuesday, January 27, 2009 4:45 PM > > Subject: Re: [osg-users] Dragge

Re: [osg-users] Dragger rendering issue

2009-01-27 Thread Ruqin Zhang
on of >> OSG later that 2.6 though, because I had some problems in relation to >> transforms and subgraph cameras which Robert helped me to fix. >> The other 'enhancement' I made was to add an autotransform node to keep >> the dragger geometry the same size on th

[osg-users] Dragger rendering issue

2009-01-26 Thread Ruqin Zhang
Hi, I got an issue about osgManipulator::dragger. When I set up a dragger, sometime it just hide (totally or partially) inside the selected object. So, I am wondering if there is some sort of way that I could always force the dragger rendered on top of the selected object to make it fully visible

Re: [osg-users] How to set the size of a point in osg?

2008-11-20 Thread Ruqin Zhang
in that case, you have to enable > GL_VERTEX_PROGRAM_POINT_SIZE by setMode(GL_VERTEX_PROGRAM_POINT_SIZE, osg:: > StateAttribute::ON); on a stateset. > > Ruqin Zhang wrote: > >> Hi, >> >> I couldn't find any function to set the point size, can anyone help? Here >> is th

[osg-users] How to set the size of a point in osg?

2008-11-20 Thread Ruqin Zhang
Hi, I couldn't find any function to set the point size, can anyone help? Here is the code: osg::ref_ptr averageGeom = new osg::Geometry(); averageGeom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet:POINTS, 0, averageArray->size())); In this way, it will draw the points based on default s

[osg-users] "osg::ref_ptr" instead of "osg::Group *"

2008-10-19 Thread Ruqin Zhang
Hi, I have the following code: osg::Group *parent = dynamic_cast(node->getChild(0)); Here, if I want to use "osg::ref_ptr" instead of "osg::Group *", how can I implement it? Thanks! ___ osg-users mailing list osg-users@lists.openscenegraph.org http://li

[osg-users] Screen coordinate to world coordinate

2008-10-11 Thread Ruqin Zhang
Hi, I got a problem when implementing code to transform from screen coordinate to world coordinate. Here is the code: void ASDSPickHandler::pick(const osgGA::GUIEventAdapter &ea, osgViewer::Viewer *viewer) { .. osg::Vec3f primitivePosition(ea.getX(), ea.getY(), 0.0f); os