Re: [osg-users] how to draw a Curved Surface?

2015-11-24 Thread Sebastian Messerschmidt

Bean,
Sorry, but I'm not a human debugger.
It returns false because you are not hitting anything. It is up to you 
to analyze the parameters passed to the intersector. Usually one would 
use window coordinates from a pick event however.

You are not giving enough information here.

Cheers
Sebastian


Hi Sebastian,
 I use the way about your method, but I get zero 
point. I may use wrong. Here is the code:

   const float x = v1.x();
const float y = v1.y();
const float look_offSet = 10.0f;
osg::ref_ptr polyIt = new 
osgUtil::PolytopeIntersector(osgUtil::Intersector::PROJECTION, x - 
look_offSet , y - look_offSet, x + look_offSet, y + look_offSet );
polyIt->setDimensionMask(osgUtil::PolytopeIntersector::DimZero);// 
only pick points


osgUtil::IntersectionVisitor iv(polyIt );

m_OSG->getViewer()->getCamera()->accept(iv);
osg::ref_ptr v = new osg::Vec3Array;

if (polyIt->containsIntersections())//this is "false" Why???
{
   .
 }
cheers,
Bean


___
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


Re: [osg-users] how to draw a Curved Surface?

2015-11-23 Thread Bean Bean
Hi Sebastian,
 I use the way about your method, but I get zero point.
I may use wrong. Here is the code:
   const float x = v1.x();
const float y = v1.y();
const float look_offSet = 10.0f;
osg::ref_ptr polyIt = new
osgUtil::PolytopeIntersector(osgUtil::Intersector::PROJECTION, x -
look_offSet , y - look_offSet, x + look_offSet, y + look_offSet );
polyIt->setDimensionMask(osgUtil::PolytopeIntersector::DimZero);// only
pick points

osgUtil::IntersectionVisitor iv(polyIt );

m_OSG->getViewer()->getCamera()->accept(iv);
osg::ref_ptr v = new osg::Vec3Array;

if (polyIt->containsIntersections())//this is "false"Why???
{
   .
 }
cheers,
Bean
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface?

2015-11-23 Thread Bean Bean
Hi Sebastian,
 I use the way about your method, but I get zero point.
I may use wrong. Here is the code:
   const float x = v1.x();
const float y = v1.y();
const float look_offSet = 10.0f;
osg::ref_ptr polyIt = new
osgUtil::PolytopeIntersector(osgUtil::Intersector::PROJECTION, x -
look_offSet , y - look_offSet, x + look_offSet, y + look_offSet );
polyIt->setDimensionMask(osgUtil::PolytopeIntersector::DimZero);// only
pick points

osgUtil::IntersectionVisitor iv(polyIt );

m_OSG->getViewer()->getCamera()->accept(iv);
osg::ref_ptr v = new osg::Vec3Array;

if (polyIt->containsIntersections())//this is "false"Why???
{
   .
 }
cheers,
Bean
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface?

2015-11-20 Thread Christian Buchner
If your terrain surface uses a GLSL fragment shader, you could add a 2D
point in polygon test on the x/y coordinate and add or blend a highlighting
color to the generated fragment when it passes the PIP test. It might get
kind of slow when your enclosing polygons has a lot of vertices.

For a decent PIP test algorithm, look here:
http://stackoverflow.com/questions/11716268/point-in-polygon-algorithm


2015-11-18 12:58 GMT+01:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Hello Bean?
>
> You can use the polytop intersector to get all primitives inside and draw
> them with an polygon offset applied on top of the original geometry.
>
> Cheers
> Sebastian
>
> primitive problem
>
> 
>
>
> 
>
>
> 1、how to draw a Curved Surface on the top of terrain? like the fig.
> 2、 how to compute the surface area of the Curved Surface?
> [image: 内嵌图片 1]
> I  want to use  polytope intersector, but I don't have  inspiration. So
> can you give me some advise?
> thank you a lot.
>
>
> ___
> osg-users mailing 
> listosg-users@lists.openscenegraph.orghttp://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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface?

2015-11-18 Thread Sebastian Messerschmidt

Hello Bean?

You can use the polytop intersector to get all primitives inside and 
draw them with an polygon offset applied on top of the original geometry.


Cheers
Sebastian

primitive problem





1、how to draw a Curved Surface on the top of terrain? like the fig.
2、 how to compute the surface area of the Curved Surface?
内嵌图片 1
I  want to use  polytope intersector, but I don't have  inspiration. 
So can you give me some advise?

thank you a lot.


___
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


Re: [osg-users] how to draw a Curved Surface on the top of terrain?

2009-08-06 Thread Pan Li
Hi,

thanks for all your replies;
use overlaynode,but the projected texture is not right,
any ideas?thanks!!
attached :
yellow lines-profile of geometry 


Code:
geometry-addPrimitiveSet(new 
osg::DrawArrays(osg::PrimitiveSet::POLYGON,0,v-size())) ;
geode-addChild(geometry);
osgSim::OverlayNode::OverlayTechnique technique
= 
osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY;
osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode(technique);
overlayNode-setOverlaySubgraph(geode);
overlayNode-setOverlayTextureSizeHint(1024);
overlayNode-setOverlayTextureUnit(1);

// insert the OverlayNode between the coordinate system node and its children.
for(unsigned int i=0; iroot-getNumChildren(); ++i)
{
overlayNode-addChild( root-getChild(i) );
}
root-removeChildren(0, root-getNumChildren());
root-addChild(overlayNode);



thanks for your help!

Thank you!

Cheers,
Pan

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



attachment: error.JPG___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface on the top of terrain?

2009-08-06 Thread Chris 'Xenon' Hanson
Pan Li wrote:
 I want to draw a curved surface dynamic, like the function Mesure area in 
 skyline.
 now i have the profile line of the curved surface,but just lines,not a 
 polygon or a surface.

  Well, the example you showed is using texturing. I suspect if that's the 
effect you
want, you'll need to take the perimeter data you have, rasterize it into a 2D 
texture
(GDAL can do this for you) and add the texture as a second layer.

-- 
Chris 'Xenon' Hanson, omo sanza lettere  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
There is no Truth. There is only Perception. To Perceive is to Exist. - Xen
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] how to draw a Curved Surface on the top of terrain?

2009-08-05 Thread John Vidar Larring

Hi Jason,

Last time I checked (half a year ago), osggis did no create a curved 
polygon when creating a filled polygon for e.g. Russia. Since no 
sampling points are created inside the polygon the tessellated triangles 
goes straight from one edge to the other thought the ground.


It would be great news if this has been fixed i later versions of 
osggis! Please let me know.


// John

Jason Beverage wrote:

Hi Lipan,

You could look into using projected textures with the 
osgSim::OverlayNode or if you are rendering vector data such as that 
from an ESRI shapefile I'd recommend looking at osggis at 
http://www.osggis.org.


Jason

On Mon, Aug 3, 2009 at 7:15 AM, Pan Li osg...@163.com 
mailto:osg...@163.com wrote:


Hi,

1、how to draw a Curved Surface on the top of terrain? like the fig1.
2、how to compute the surface area of the Curved Surface?
any examples??
thanks a lot!!

Cheers,
lipan

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




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



--
This message has been scanned for viruses and
dangerous content by *MailScanner* http://www.mailscanner.info/, and is
believed to be clean.




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



--
Best regards,
John
WeatherOne

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


Re: [osg-users] how to draw a Curved Surface on the top of terrain?

2009-08-05 Thread Glenn Waldron
No - osggis does not drape polygon geometries.

Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791


On Wed, Aug 5, 2009 at 5:45 AM, John Vidar Larring larr...@weatherone.tvwrote:

 Hi Jason,

 Last time I checked (half a year ago), osggis did no create a curved
 polygon when creating a filled polygon for e.g. Russia. Since no sampling
 points are created inside the polygon the tessellated triangles goes
 straight from one edge to the other thought the ground.

 It would be great news if this has been fixed i later versions of osggis!
 Please let me know.

 // John

 Jason Beverage wrote:

 Hi Lipan,

 You could look into using projected textures with the osgSim::OverlayNode
 or if you are rendering vector data such as that from an ESRI shapefile I'd
 recommend looking at osggis at http://www.osggis.org.

 Jason

 On Mon, Aug 3, 2009 at 7:15 AM, Pan Li osg...@163.com mailto:
 osg...@163.com wrote:

Hi,

1、how to draw a Curved Surface on the top of terrain? like the fig1.
2、how to compute the surface area of the Curved Surface?
any examples??
thanks a lot!!

Cheers,
lipan

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




___
osg-users mailing list
osg-users@lists.openscenegraph.org
mailto:osg-users@lists.openscenegraph.org

 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



 --
 This message has been scanned for viruses and
 dangerous content by *MailScanner* http://www.mailscanner.info/, and is
 believed to be clean.


 

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



 --
 Best regards,
 John
 WeatherOne


 ___
 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


Re: [osg-users] how to draw a Curved Surface on the top of terrain?

2009-08-04 Thread Jason Beverage
Hi Lipan,

You could look into using projected textures with the osgSim::OverlayNode or
if you are rendering vector data such as that from an ESRI shapefile I'd
recommend looking at osggis at http://www.osggis.org.

Jason

On Mon, Aug 3, 2009 at 7:15 AM, Pan Li osg...@163.com wrote:

 Hi,

 1、how to draw a Curved Surface on the top of terrain? like the fig1.
 2、how to compute the surface area of the Curved Surface?
 any examples??
 thanks a lot!!

 Cheers,
 lipan

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




 ___
 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


Re: [osg-users] how to draw a Curved Surface on the top of terrain?

2009-08-04 Thread Pan Li
Thanks for your reply!

I want to draw a curved surface dynamic, like the function Mesure area in 
skyline.
now i have the profile line of the curved surface,but just lines,not a polygon 
or a surface.
my issue is: 
how to display the profile line to be a  enclosed area, not lines.
use OverlayNode??

Thank you!

Cheers,
Pan

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





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