Re: [osg-users] kmz files

2017-12-22 Thread Jeff Biggs


Nick,

I have used osgEarth to digest KML, Not sure if it will read the 
compressed KMZ form though.  osgEarth then parses the XML and I believe 
that it will read the collada (dae) file as long as the plugin has been 
built.


https://github.com/gwaldron/osgearth/blob/master/src/osgEarthDrivers/kml/KML

jeff


On 12/22/17 10:58 AM, Trajce Nikolov NICK wrote:

Hi Community,

there was a tool called kmzconvert that suppose to convert kmz files 
to ive/osg. Anyone knows where can I get it? Or is there another way 
to have kmz files in OSG?


Thanks a bunch!

Nick

--
trajce nikolov nick


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



--
Jeff Biggs

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


Re: [osg-users] Polytope from view frustum

2016-11-02 Thread Jeff Biggs


try this...

osg::Polytope GetViewPolytope(
const osg::Matrix ,
const osg::Matrix ,
const osg::Matrix )
{
osg::Polytope clipspace;
clipspace.setToUnitFrustum(true, true);

// composite matrix
osg::Matrixd mvp = m * v * p;

// transform from clip space to local coords
osg::Polytope local;
local.setAndTransformProvidingInverse(clipspace, mvp);

return local;
}

// --- Sample use case ---

osg::Camera *cam;
osg::Matrixd entityBodyMatrix;

osg::Polytope viewPolytope = GetViewPolytope(
cam->getProjectionMatrix(), cam->getViewMatrix(), entityBodyMatrix);

const osg::BoundingSphere boundSphere;

if (viewPolytope.contains(boundSphere) {
// sphere is inside of view
}

jeff



On 11/2/16 3:43 AM, Robert Osfield wrote:

On 1 November 2016 at 21:45, Trajce Nikolov NICK
<trajce.nikolov.n...@gmail.com> wrote:

Hi Community,

anyone knowing how to achieve this and with will to share?

Thanks a bunch as always !!

Have a look at the API's...

First one to look at is osg::Polytope, create one of these with a unit
frustum.  This will be in clip space.

Next step transform this Polytope by the projection matrix using the
transformProvidingInverse() method (to transform a plane you multiple
it by the inverse of that matrix), so in our case the projection
matrix transform from eye space into clip space which is the inverse
of the transform we intend, but thanks to the way that planes are
transformed we can just use the projection matrix directly as long as
we use the transformProvidingInverse().  See the src/osg/CullStack.cpp
to see this in action.

Then transform into object coordinates using the same method by
providing the view and model matrices.

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





--
Jeff Biggs

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