Re: [osg-users] Draw line in 3D screen

2012-01-12 Thread Lalit Manchwari
Hi,

Thks Robert and Shayne

I solve my problem with your direction.


Cheers,
Lalit

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





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


Re: [osg-users] Draw line in 3D screen

2012-01-09 Thread Lalit Manchwari
Dear Shayne

I use polytope to pick the 3D coordinate of data. 

……..
osg::ref_ptr picker;
picker = new osgUtil::PolytopeIntersector(osgUtil::Intersector::WINDOW, x-w, 
y-h, x+w, y+h );
osgUtil::IntersectionVisitor iv( picker );
viewer->getCamera()->accept( iv );
if(picker->containsIntersections())
{
………
}

I picked first point in 3D data and similarly the second point. The primitive 
is set for these two points as LINES and a line gets drawn on screen.

osg::ref_ptr points = new osg::Vec3Array; 
osg::ref_ptr color = new osg::Vec4Array; 
osg::ref_ptr geometry( new osg::Geometry); 

points->push_back(..get first x,y,z using osgUtil::PolytopeIntersector()…); 
points->push_back(..get second  x,y,z using osgUtil::PolytopeIntersector()…);

color->push_back(osg::Vec4(1.0,0.0,0.0,1.0)); 
geometry ->setVertexArray(points.get()); 
geometry ->setColorArray(color.get()); 
geometry ->setColorBinding(osg::Geometry::BIND_OVERALL); 
geometry ->addPrimitiveSet(new osg::DrawArrays(GL_LINES,0, points->size()));

I cannot use polytope in the area where there are no data points.

I think my line drawing procedure is wrong and this is why I am not able to do 
so in those areas where there are no points.
A line can be anywhere, not necessarily through points, in this space for some 
applications.


Thank you!

Cheers,
Lalit

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





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


Re: [osg-users] Draw line in 3D screen

2012-01-09 Thread Lalit Manchwari
Dear Robert:

Thanks for input. I am trying to re-phrase my question.

I have loaded a 3D data (X,Y,Z) on screen and can see these points as in 
screenshot_1. Also, I can, using mouse, draw line through these points (also 
shown.) However, if I want to draw a line as shown in screenshot_2, I am not 
able to do this, as this line does not passes through any loaded data.
What can be the procedure to draw these lines using mouse which are not passing 
through any data point.


Thank you!

Cheers,
Lalit

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




Attachments: 
http://forum.openscenegraph.org//files/screenshot_2_123.jpg
http://forum.openscenegraph.org//files/screenshot_1_443.jpg


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


[osg-users] setUseVertexBufferObjects(..) create problem in osg 3.0.1

2012-01-04 Thread Lalit Manchwari
Hi,

I have written a program using visual studio 2008 and osg 2.8.5. In this 
program I was using  

geometry->setUseDisplayList( false );  //Disable display lists 
geometry->setUseVertexBufferObjects( true ); //Enable VBO 

But when I switch higher version of visual studio (2010) and osg ( 3.0.1), it 
create problem. When I comment above line program works fine.

I am using graphics card:  NVIDIA GeoForce 6800 XT (Microsoft Corporation - 
WDDM)
Is that problem due to graphics card? 


Thank you!

Cheers,
Lalit

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





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


Re: [osg-users] [osgPlugins] Problem in loading Shape file

2011-12-23 Thread Lalit Manchwari
Thanks ulrich for your answer

I followed your instruction and now program is not crashing. But in some file 
it does not load the complete shape file. I have attached here a shape file and 
its snapshot (with complete view).  

Please could you help.   


Thank you!

Cheers,
Lalit

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




Attachments: 
http://forum.openscenegraph.org//files/completeview_836.jpg
http://forum.openscenegraph.org//files/testshapefile_371.rar


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


[osg-users] [osgPlugins] Problem in loading Shape file

2011-12-22 Thread Lalit Manchwari
Hi,

I am loading *.shp file in my program. In some files program works fine (mostly 
shape file with lines) but in some other files program crashed. 
My code is :

...
osg::Geode* geode = dynamic_cast < osg::Geode* > 
(osgDB::readNodeFile("Test.shp"));
osg::ref_ptr < osg::Group >  group(new osg::Group);
osg::ref_ptr < osgViewer::Viewer > mViewer(new osgViewer::Viewer);

group->addChild(geode);
mViewer->setSceneData(group.get());
mViewer->run();
... 

Is it correct way?

I am using WindowXp 32 bit os, osg 2.8.5 prebuilt library.

Thank you!

Cheers,
Lalit

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





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


[osg-users] Draw line in 3D screen

2011-12-02 Thread Lalit Manchwari
Hi,

I am loading a large number of 3D points (X, Y, Z) on OSG.  I want to draw line 
on screen not necessarily passing through loaded points.  I am using 
osgUtil::PolytopeIntersector but it draws lines which essentially pass through 
loaded points.  What can be done to draw line by movement of mouse dynamically 
anywhere in screen, i.e. could have its nodes on the loaded points and as well 
on the area where there are no loaded points.
Thank you!

Cheers,
Lalit

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





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


Re: [osg-users] Flush event stack

2011-05-02 Thread Lalit Manchwari
Thanks for reply, 

I have some another question.

Using osgUtil::PolytopeIntersector we get the x, y, and z coordinates at 
current mouse position. Can I do opposite of it, means if I have x, y and z 
coordinate then, can I calculate the screen coordinate. Actually I have to find 
points around a given coordinate.
Or is there another method to find the nearest points around a given point 
(range is also given)
 

Thank you!

Cheers,
Lalit

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





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


[osg-users] Flush event stack

2011-04-29 Thread Lalit Manchwari
Hello friends,
 
I am working on 3-D point data and using osgUtil::PolytopeIntersector to get 
the x, y, and z coordinates on mouse move event and show it on status bar. But 
my program becomes very slow.
I had make a class: class CMousePickHandle : public osgGA::GUIEventHandler and 
working on osg version 2.8.2 .
Is there any method for flush the event stack?

Thank you!

Cheers,
Lalit

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





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


[osg-users] Problem in opening multiple files while using VBO

2011-03-04 Thread Lalit Manchwari
Hi,

I made a MDI application using MFC with the help of OSGMDI project, which 
displays the point data. I am using VBO in my application using these two lines:

geometry->setUseDisplayList( false );  //Disable display lists
geometry->setUseVertexBufferObjects( true ); //Enable VBO 


Now the problem is, when I open a file the application works well and on close 
the child window it releases the memory. But when I open another file without 
closing the main window, it breaks.
But when I comment these two lines then program working well for multiple files 
but it becomes slow.

I can’t understand the problem please help me. 


Thank you!

Cheers,
Lalit

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





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


[osg-users] Identify whether Geode is inside the viewport or not...

2010-11-19 Thread Lalit Manchwari
Hi,

I am working with LiDAR data. Its a huge data containing the information of X, 
Y, Z co-ordinates. I have divided this data into spatial blocks and making a   
Geode for every block. I want to increase the density of point cloud as the 
user zoom in the data.
I want to know how can I identify that which Geode or block is inside or 
outside the viewport. 

Thank you!

Cheers,
Lalit

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





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


Re: [osg-users] Disable the Mouse default event in osg

2010-10-29 Thread Lalit Manchwari
Hi,

... Thanks for reply..
If i comment the manipulator then data is not displaying. I m using code...


...
...
lasGeometry->setVertexArray( lasVertices);
lasGeometry->setColorArray(colors);
lasGeometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
lasGeometry->addPrimitiveSet(lasPrimitive);
root->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);

//viewer.setCameraManipulator(new osgGA::TrackballManipulator());

viewer.setSceneData( root );
viewer.addEventHandler(new osgViewer::StatsHandler);
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
viewer.realize();
while( !viewer.done() )
{
viewer.frame();
}   
...
.

And is there any osg functions that i can directly for rotate pan and zoom 
buttons.  

Thank you!

Cheers,
Lalit

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





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


[osg-users] Disable the Mouse default event in osg

2010-10-28 Thread Lalit Manchwari
Hi,

... I am new in OpenSceneGraph. I want to disable the mouse event and use these 
event (Rotate, Zoom, Pan ) in separate buttons.  

Thank you!

Cheers,
Lalit Manchwari

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





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