Re: [osg-users] Please mirro187, work on your communication

2021-03-16 Thread mirr...@gmail.com
Sorry, I don't have Internet in my work environment.Unable to provide 
complete test information

在2021年3月16日星期二 UTC+8 下午5:20:25 写道:

> Do you not wonder yourself, why hardy anyone answers to you?
>
> If you put a bit more work into your messages, then this might change
> quite a bit, because currently they're hard to understand at all.
>
> Most of the time you don't add any context to your problem, e.g. what
> you're trying to achieve from a high level point of view.
>
> Also how you write your messages isn't really reader friendly. Don't
> put your whole question into the subject line and only code into the
> message itself. Put only a very short summary into the subject line
> and then interleave the code example with explaining the problem you have
> with it. Also saying what you would have expected might help.
>
> You can't expect others to put work into solving your problems if you
> put almost no effort into it explaining them.
>
> Greetings,
> Daniel
>

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/39c52c94-9c60-4630-9fe0-5d8c3c185b71n%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How do you create the osg::Planeof PolytopeIntersector that will give you the right intersection?

2021-03-16 Thread mirr...@gmail.com
win10
// 
osg::Matrixd proj  = osg::Matrixd::identity();
proj.makePerspective(60, frustumAspectWidth/frustumAspectHeight, 
frustumNear, frustumFar);
//
const double mynear = proj(3, 2) / (proj(2, 2) - 1.0);
const double myfar = proj(3, 2) / (1.0 + proj(2, 2));
//
const double nLeft = mynear * (proj(2, 0) - 1.0) / proj(0, 0);
const double nRight = mynear * (1.0 + proj(2, 0)) / proj(0, 0);
const double nTop = mynear * (1.0 + proj(2, 1)) / proj(1, 1);
const double nBottom = mynear * (proj(2, 1) - 1.0) / proj(1, 1);
const double fLeft = myfar * (proj(2, 0) - 1.0) / proj(0, 0);
const double fRight = myfar * (1.0 + proj(2, 0)) / proj(0, 0);
const double fTop = myfar * (1.0 + proj(2, 1)) / proj(1, 1);
const double fBottom = myfar * (proj(2, 1) - 1.0) / proj(1, 1);
//
_projectPt[0] = osg::Vec3d(0.0, 0.0, 0.0);
_projectPt[1] = osg::Vec3d(nLeft, nBottom,  -mynear);
_projectPt[2] = osg::Vec3d(nRight, nBottom, -mynear);
_projectPt[3] = osg::Vec3d(nRight, nTop, -mynear);
_projectPt[4] = osg::Vec3d(nLeft, nTop,  -mynear);
_projectPt[5] = osg::Vec3d(fLeft, fBottom,  - myfar);
_projectPt[6] = osg::Vec3d(fRight, fBottom, - myfar);
_projectPt[7] = osg::Vec3d(fRight, fTop,  -myfar);
_projectPt[8] = osg::Vec3d(fLeft, fTop,  - myfar);
osg::Polytope viewFrstumPoly;
//
osg::Matrixd ViewM = _view->getCamera()->getInverseViewMatrix();
//
osg::Vec3d tempProjectPt[9];
//tempProjectPt[0] = _projectPt[0] * ViewM;
tempProjectPt[1] = _projectPt[1] * ViewM;
tempProjectPt[2] = _projectPt[2] * ViewM;
tempProjectPt[3] = _projectPt[3] * ViewM;
tempProjectPt[4] = _projectPt[4] * ViewM;
tempProjectPt[5] = _projectPt[5] * ViewM;
tempProjectPt[6] = _projectPt[6] * ViewM;
tempProjectPt[7] = _projectPt[7] * ViewM;
tempProjectPt[8] = _projectPt[8] * ViewM;
{
viewFrstumPoly.add(osg::Plane(tempProjectPt[1],tempProjectPt[5],tempProjectPt[8]));
}
{
viewFrstumPoly.add(osg::Plane(tempProjectPt[2],tempProjectPt[7],tempProjectPt[6]));
}

{
viewFrstumPoly.add(osg::Plane(tempProjectPt[3], 
tempProjectPt[4],tempProjectPt[8]));
}

{
viewFrstumPoly.add(osg::Plane(tempProjectPt[1],tempProjectPt[2],tempProjectPt[6]));
}
{
viewFrstumPoly.add(osg::Plane(tempProjectPt[5],tempProjectPt[6],tempProjectPt[7]));
}
{
viewFrstumPoly.add(osg::Plane(tempProjectPt[3],tempProjectPt[4],tempProjectPt[1]));
}
osg::ref_ptr picker = new 
osgUtil::PolytopeIntersector(osgUtil::Intersector::MODEL, poly);
picker->setPrecisionHint(osgUtil::Intersector::USE_DOUBLE_CALCULATIONS);
picker->setPrimitiveMask(osgUtil::PolytopeIntersector::POINT_PRIMITIVES);
picker->setIntersectionLimit(osgUtil::Intersector::NO_LIMIT);
//
osgUtil::IntersectionVisitor iv(picker);
_videoFusionNode->accept(iv);//group of scene 
if (picker->containsIntersections())
{
//
}

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/32729314-2d08-46c7-973c-812c6d8a2bb0n%40googlegroups.com.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Please mirro187, work on your communication

2021-03-16 Thread Daniel Trstenjak
Do you not wonder yourself, why hardy anyone answers to you?

If you put a bit more work into your messages, then this might change
quite a bit, because currently they're hard to understand at all.

Most of the time you don't add any context to your problem, e.g. what
you're trying to achieve from a high level point of view.

Also how you write your messages isn't really reader friendly. Don't
put your whole question into the subject line and only code into the
message itself. Put only a very short summary into the subject line
and then interleave the code example with explaining the problem you have
with it. Also saying what you would have expected might help.

You can't expect others to put work into solving your problems if you
put almost no effort into it explaining them.

Greetings,
Daniel

-- 
You received this message because you are subscribed to the Google Groups 
"OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osg-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/20210316092021.GA12856%40octa.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org