[osg-users] How to texture map Box/Sphere/Cone/Capsule/Cylinder

2017-08-07 Thread Paul Leopard
Trying to map a simple, uniform texture onto an osg::Shape instance and not 
finding a way to get a hold on the underlying osg::Geometry so I can call 
setTexCoordArray(...) on it ...

How would I do so?

example code :

osg::ref_ptr rShape = new osg::Sphere( center, radius );
osg::ref_ptr rDrawable = new osg::ShapeDrawable( rShape );
pGeom = rDrawable->asGeometry(); // returns NULL
rGeode->addDrawable( rDrawable );
rBaseNode->addChild( rGeode );

osg::ref_ptr rOSGTexture = CreateTexture( ... );

osg::Vec2 texCoords[] =
{
   osg::Vec2(0,1),
   osg::Vec2(0,0),
   osg::Vec2(1,0),
   osg::Vec2(1,1)
};
int numTexCoords = sizeof(texCoords)/sizeof(osg::Vec2);
pGeom->setTexCoordArray(0,new osg::Vec2Array(numTexCoords,texCoords)); // NULL 
POINTER PASSED HERE


things are more like they are now than they have ever been before

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





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


Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-07 Thread Robert Osfield
On 7 August 2017 at 16:40, Jordi Torres  wrote:

> Can I ask for a coverity_scan build before tagging the release?
>
>>
>> 
>>
>
You can indeed ask :-)

The coverity_scan is based on master rather than the 3.4 branch so it won't
affect the 3.4.1 release.

Doing a converity_scan and fix cycle is on my TODO list, should get to it
soon as there haven't been many issues with 3.4.1 reported for me to chase
up :-)

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


Re: [osg-users] Please test OpenSceneGraph-3.4 in prep for 3.4.1

2017-08-07 Thread Jordi Torres
Hey Robert,

Can I ask for a coverity_scan build before tagging the release?

Thx.

2017-07-31 10:37 GMT+02:00 Dennis Cappendijk :

> Thank you!
>
> Cheers,
> Dennis
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71350#71350
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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


[osg-users] How to change "field of view"(FOV), distance.

2017-08-07 Thread Maxim Senin
Hi,
How to change "field of view"(FOV) and distance?
I used :
... 

Thank you!

Cheers,
Maxim
Code:
osg::CameraView* cameraview = new osg::CameraView();
cameraview->addChild(group);
cameraview->setFieldOfView(120.0f);
osgViewer::Viewer viewer;
viewer.setSceneData(cameraview);



but it's not work. Help me please.

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





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


Re: [osg-users] check status of pagedlod

2017-08-07 Thread Sebastian Schmidt

robertosfield wrote:
> 
> What do you mean by "all of this is finished"?  In application "A" or "B"?
> 
> 
> It's hard to know really what you are after.
> 
> 
> The only thing I can suggest at this stage, if a plugin is taking time to 
> load and it's load is not deterministic due it being loaded in response to a 
> PagedLOD file request then why not just preload the plugin or statically link 
> it into your application so it doesn't happen during rendering of the frame.
> 
> 
> Robert.
> 


I mean when all of the initialization of osg application "A" is finished. It 
must be loaded during runtime, because the plugin is also waiting for a 
established network connection with app "A" that is rendering stuff to the 
texture.

I will try osgDB::Registry, maybe get ReadResult, for this.


OSG Version: 3.0.1
OS: OpenSuse Leap 42.1

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





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


Re: [osg-users] RenderBin vs. SlaveCamera

2017-08-07 Thread Sebastian Messerschmidt


Hi Werner,

I'm using slave cameras only for certain multi-channel setups where I 
need multiple viewports rendering the same content with different 
frusta. For multipass applications (and I simply consider HUD to be a 
separate pass) I always use normal cameras (with absolute reference 
frame for fullscreen passes and relative for composing passes).


You can assign an explicit number to the camera order by using.

camera->setRenderOrder(osg::Camera::PRE_RENDER, pass_number);

I use the PRE_RENDER scheme, since all passes of my offscreen rendering 
need to complete before the output is presented. Given your scenario you 
could of course simply set the render order of your HUD camera to 
something high.


Setting up rendering order with the Geometry RenderBin seems akward, 
since the HUD geometry is supposed to be rendered by the HUD-camera 
only. So a slave camera might not be the best option (apart from the 
fact, that the HUD is supposed to have its own projection and 
transform-matrix).


hth
Sebastian


Hi all,

I'm restructuring my project because I want to implement some multi pass 
effects.
I have some problems understanding the different approaches for example 
when

creating HUD displays.
The approach I used so far is attaching a SlaveCamera and puttung it in 
PostRender pass.
On the other hand I found an approach of just attaching the matrices to 
the root node and

assigning the HUD geometry to a RenderBin with high number.

I'd like to understand the difference of the approaches and the pros and 
cons.


Is there any one who can help me with that?

Thanks

- Werner -

___
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] RenderBin vs. SlaveCamera

2017-08-07 Thread Johny Canes
Hi,

I can help you a little with this.

I personally use a very simple copy shader and a fullscreen quad. Here's an 
example.


Code:

// camera setup is a bit crowded, but involves render target implementation set 
to frame_buffer_object, no culling, render order set to PRE, and a ortho2d(w,h) 
projection matrix.

ref_ptr quad;
quad = createTexturedQuadGeometry(Vec3(), Vec3(Width, 0.0, 
0.0), Vec3(0.0, Height, 0.0));

ref_ptr geode = new Geode;
geode->addDrawable( quad.get() );

auto ss = geode->getOrCreateStateSet();

ss->setAttributeAndModes( shader->program, StateAttribute::ON );

gViewer->addSlave( camera, false );



Thank you!

Cheers,
Johny

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





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