[osg-users] GPU Monitoring for OSG

2009-07-21 Thread Nadia Comanici
Hi,

What software can I use to monitor how much of the graphics card is used when I 
run a certain application, that uses OSF? I want to see how much my application 
uses the GPU

Thank you!

Cheers,
Nadia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15172#15172





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Surface smoothing

2009-06-30 Thread Nadia Comanici
Hi,

I have a Vec3Array of points and the associated triangles generated using the 
DelaunayTriangulator. Is there any way of making the surface more smooth (now 
it's really pointy because of the triangles). From these points and triangles I 
have created a Geometry and added it to a Geode.

I have tried using 

Code:
osgUtil::TriStripVisitor tsv;
tsv.stripify( *geometry );



to minimize the number of triangles, but it seems not to be working, as the 
number of triangles is the same after the operation; Is there anything do any 
additionally?

Also, I tried using the SmoothingVisitor

Code:
osgUtil::SmoothingVisitor sv;
geode-accept(sv);



but there is no visible result.

What do you recommend using or am I missing something in the code?

Thank you!

Cheers,
Nadia[/code]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=14682#14682





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] triangulation

2009-06-26 Thread Nadia Comanici
Hi,

Besides adding the triangles, as a primitive set, you also have to set the 
vertex array dor the geometry, like this:


Code:
triangleGeometry-setVertexArray(points);



This should make it visible, but the surface will look flat, as the 
triangulation does not generate normals for the triangles; you could use the 
SmoothingVisitor to do this, so your code should look like this:


Code:
osg::Geometry* triangleGeometry = new osg::Geometry();
triangleGeometry-addPrimitiveSet(d);
triangleGeometry-setVertexArray(points);

osg::Geode* geode=new osg::Geode();
geode-addDrawable(triangleGeometry);

osgUtil::SmoothingVisitor sv;
geode-accept(sv); 



Cheers,
Nadia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=14578#14578





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Geometry drawable color after Triangulation

2009-06-25 Thread Nadia Comanici
Thank you, J-S, but unfortunately the object still looks flat :(

Cheers,
Nadia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=14484#14484





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Geometry drawable color after Triangulation

2009-06-25 Thread Nadia Comanici
Hi ulrich,

Thank you very much, now I can see it just fine! 

Another question, though, because I am new to osg, and probabily this is the 
next step I want to do the previous code: does osg have any functions for 
smoothing a surface? or should I implement it manually?

Cheers,
Nadia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=14503#14503





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Problems with tutorial on Handling Keyboard Input to Update a Callback

2009-06-24 Thread Nadia Comanici
Hi,

I've just started using osg, and i've tried the tutorials, like the Handling 
Keyboard Input to Update a Callback tutorial, and i wrote the following code:


Code:
osgViewer::Viewer viewer;
ObjectManipulator* displayHandler = new ObjectManipulator();
viewer.addEventHandler(displayHandler); 
viewer.setSceneData(geode);
viewer.setUpViewInWindow(100, 100, 800, 600); 
viewer.run();



and


Code:
#include osgGA/GUIEventHandler
class ObjectManipulator: public osgGA::GUIEventHandler
{
public:
virtual bool handle(const osgGA::GUIEventAdapter ea, 
osgGA::GUIActionAdapter aa);
virtual void accept(osgGA::GUIEventHandlerVisitor v)   { 
v.visit(*this); };
};

bool ObjectManipulator::handle(const osgGA::GUIEventAdapter 
ea,osgGA::GUIActionAdapter aa)
{   
  switch(ea.getEventType())
  {
case(osgGA::GUIEventAdapter::KEYDOWN):
{
   switch(ea.getKey())
  {
case 'w':
std::cout   w key pressed  std::endl;
return false;
break;
default:
return false;
  } 
}
default:
  return false;  
  }
}



The problem is that it never gets inside the 
case(osgGA::GUIEventAdapter::KEYDOWN) instruction; Do I need to include 
anything else? or why doesn't it work?

Thank you!
  Nadia[/code]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=14433#14433





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problems with tutorial on Handling Keyboard Input to Update a Callback

2009-06-24 Thread Nadia Comanici
Thank you very much ulrich, it was exactly what i needed

Cheers,
Nadia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=1#1





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Geometry drawable color after Triangulation

2009-06-24 Thread Nadia Comanici
Hi,

I have tried applying a DelaunayTriangulator on a set of points and generating 
the wireframe and the solid model, from the triangles that the 
DelaunayTriangulator generates. The wireframe model looks really great, but the 
solid one has the same color on all the faces, so I cannot distinguish it as an 
3D object. What should I set in order to see the 3D model, not just a big chunk 
of the same color?

The code I used looks like this:

Code:

char* fileName = argv[1];

//read the points
osg::Vec3Array* points = new osg::Vec3Array();  

unsigned nPoints = ReadFile(fileName,points);
if (nPoints == -1)
return 0;   

osg::Geometry* geometry = new osg::Geometry();  

// Generate the triangles
osg::ref_ptrosgUtil::DelaunayTriangulator triangulation = new 
osgUtil::DelaunayTriangulator(points);
triangulation-triangulate();   

//set the points and triangles
geometry-setVertexArray(points);
geometry-addPrimitiveSet(triangulation-getTriangles());   

//set the color
osg::Vec4Array * colors = new osg::Vec4Array(1);
colors-push_back(osg::Vec4d(0.0,1.0,0.0,1.0));
geometry-setColorArray(colors);
geometry-setColorBinding(osg::Geometry::BIND_OVERALL); 

//create geode and add the geometry
osg::Geode* geode = new osg::Geode();
geode-addDrawable(geometry);

//create StateSet and add it to the geode
osg::StateSet *set = new osg::StateSet();
set-setMode(GL_DEPTH_TEST, osg::StateAttribute::ON);
set-setMode(GL_LIGHTING, osg::StateAttribute::ON);
osg::PolygonMode* polymode = new osg::PolygonMode;

polymode-setMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE); 
 

set-setAttributeAndModes(polymode,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
geode-setStateSet(set);

//view the result
osgViewer::Viewer viewer;   
viewer.setSceneData(geode);
viewer.setUpViewInWindow(100, 100, 800, 600); 
viewer.run();   




Thank you!

Cheers,
Nadia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=14462#14462





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Geometry drawable color after Triangulation

2009-06-24 Thread Nadia Comanici
Hi, ulrich

  As you suggested, I tried both the methods, but the model still looks flat; 
aparently, the Triangulator  does not return any normals and i also tried this:


Code:
osgUtil::SmoothingVisitor* smoothing = new osgUtil::SmoothingVisitor();
smoothing-apply(*geode);



but still, no result :(

Nadia

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=14464#14464





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org