Re: [osg-users] calculating area of the 3d model.
Hi, Thanks paul. I will look into it. :) ... Thank you! Cheers, Uma -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69455#69455 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] calculating area of the 3d model.
Hi Uma, You might want to also look at VTK/ParaView which has some features but event then it is a non-trivial task. A while ago I needed to calculate the frontal area and it turned out easier to just render it and pixel count. The issues were due to how select works. As the GPU is optimising the rendering, it is not drawing all the triangles, if you then select and calculate on that select you will not get the correct answer. You may be able to do a variation with slicing and pixel counting (in either VTK or OSG) - my random nodes/coda here: https://github.com/internetscooter/Vespa-Labs/tree/master/VespaCFD/CalculateFrontalArea Cheers, Paul -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69451#69451 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] calculating area of the 3d model.
Hi, Thanks for the reply robert and sebastain :) ... Thank you! Cheers, Uma -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69412#69412 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] calculating area of the 3d model.
On 16 November 2016 at 13:21, Uma Devi Selvarajwrote: > I need to calculate area , perimeter & volume of a selected part or area > in 3d model. For example after rendering 3d model, if I select some > area(cloased area) , say point1 point2 point3. Point1 connected to point2 > point2 to point3, point3 connected to point1. Is it possible to do it with > the help of OSG.? The OSG has basic vector maths code that can help with the low level calculations but there no utility that provides the functionality you are after - it's very niche application specific task you are after not appropriate for a general purpose scene graph. You'll need to work out how to build each of the components necessary yourself, it's very much as task in the domain of your application. I'm afraid this is not an trivial task, it's not something I'd expect a developer new to scene graphs and vector maths to try and tackle so you may have a steep learning curve ahead if you want to tackle it yourself. Much of this learning isn't OSG specific, the OSG is only relevant to storage of data, computation of what parts of the scene graph are relevant and the maths you want to use will all be down to you and tailored to your applications needs. >And how can I get longitude,latitude and altitude for the points(say > point1).? Is there any example for this.? So that it can be helpful for me. The way you typically do this type of task is to transform local vertices of geometries into world coordinates which is typically. ECEF (Earth Center Earth Fixed) for whole earth databases, then use the osg::ElipsoidModel to compute the world coords into lats and longs. I don't recall any specific example code that does this. the headers to EllispodModel has all that you need at the low level of the conversion. > Do I need to build any other OSG application for this task.? Where does the > longitude,latitude and altitude informations are stored in 3d models > (.3ds,.osg,.osgt)? Lat, long and altitude are not generally stored in subgraphs of a scene graph, instead the subgraphs have their own local coordinate frames or may be stored in world coodinates. The only place where lat,longs and altitude come in are implicitly via the EllipsoidModel attached to a CoordinateSystemNode that can be used to decorate a scene graph. Typically only whole earth models will have CoordinateSystemNode. You always have to compute the lat, long and altitude for individual points on demand as they aren't stored, only the local/word coordinates are stored in the scene graph. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] calculating area of the 3d model.
Hi Uma Hi all, I would like to know some information. I need to calculate area , perimeter & volume of a selected part or area in 3d model. For example after rendering 3d model, if I select some area(cloased area) , say point1 point2 point3. Point1 connected to point2 point2 to point3, point3 connected to point1. Is it possible to do it with the help of OSG.? There might be some helper functions, but basically perimeter and area need some adjacency information, so I guess you need to do some additional work. And how can I get longitude,latitude and altitude for the points(say point1).? Is there any example for this.? So that it can be helpful for me. That doesn't make sense really if your "points" are not ECEF. Basically you can use the osg::CoordinateSystemNode and the projection to convert geographic and geocentric coordinates. In order to transform a local mesh to a specific lat-lon position you need to orient the model at the local tangent plane (you can get the matrix from the CoordinateSystemNode (set up with the ellipsoidmodell): osg::CoordinateSystemNode* csn = new osg::CoordinateSystemNode(); csn->setEllipsoidModel(new osg::EllipsoidModel()); osg::Matrixd local_frame = csn->computeLocalCoordinateFrame(position); For orientation simply rotate your model by the local_frame, where the position is ECEF. You can obtain an ECEF-position relative to the chosen Ellipsoid by using the Ellipsoid::computeLocalToWorldTransformFromLatLongHeight function. Do I need to build any other OSG application for this task.? Where does the longitude,latitude and altitude informations are stored in 3d models (.3ds,.osg,.osgt)? There is no fixed coordinate system in the files/OSG. The coordinates are simply numbers in an (orthonormal) coordinate frame. So it is up to you to interpret them as being angles, meters, microfortnights or whatever. Cheers Sebastian ... Thank you! Cheers, Uma -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69400#69400 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] calculating area of the 3d model.
Hi all, I would like to know some information. I need to calculate area , perimeter & volume of a selected part or area in 3d model. For example after rendering 3d model, if I select some area(cloased area) , say point1 point2 point3. Point1 connected to point2 point2 to point3, point3 connected to point1. Is it possible to do it with the help of OSG.? And how can I get longitude,latitude and altitude for the points(say point1).? Is there any example for this.? So that it can be helpful for me. Do I need to build any other OSG application for this task.? Where does the longitude,latitude and altitude informations are stored in 3d models (.3ds,.osg,.osgt)? ... Thank you! Cheers, Uma -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69400#69400 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org