Re: [osg-users] How to implement a Laser Simulation?

2019-05-29 Thread David Heitbrink
I did a similar project with adaptive headlamps a couple years ago.

The way I would do this is to think about this as sort of a spot light with a 
projector slide. So we can also think about this also a spot light with a 
shadow. 

So what I did was to setup a "slide" scene in which I would render the shape of 
what I wanted projected. So in your case you can setup a pre-render camera with 
like a 512x512 with the clear color set to black. You can then just render a 
single green line. You can do what - ever with this line, or do the laser light 
show thing and do a smiley face - whatever.

Then I would setup a camera do be your sort of laser light head, so you can add 
another camera in your scene for this. With this second pre-render camera we 
can do a depth pass. So with this you aim your depth camera at where you want 
to aim your laser. With this pre-render camera, you basically attach your 
normal scene, then only output the depth.
 
Now once you do your main rendering pass, you pass in the model-view matrix 
from the depth camera into your shader and you treat this like you would doing 
a shadow for a spot light, there are lots of tutorials on how to do this. But 
what you also do is once you have your shadow coordinate, you use this to do a 
texture lookup with your slide scene. 

So then you treat the shadow camera just like say a normal spot light shadow, 
except you  instead of just treating the light like a normal spot like, you 
take the same shadow coordinate, and lookup your slide scene for the light 
color. 

I published a paper on this for the Image Society a couple of years ago.

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





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


Re: [osg-users] osgQt & osgEarth not working with 0 margin in Qlayout

2019-05-29 Thread David Bobavid
Hi,

I have played around with this a bit more, and it seems that after setting the 
margins to 0, the timer update calling upadte() doesn't properly called the 
paintEvent on the widget.

If I make my own slot for the timer's timeout and call the _viewer->frame() on 
my own, it works just fine.

Just posting in case anyone else comes across this issue.

Cheers,
David

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





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


Re: [osg-users] How to implement a Laser Simulation?

2019-05-29 Thread Chris Hanson
So, you don't care about the line appearing interacting with the water
column, just with it interacting with the surfaces in the scene?

You could either slap a shader pass on EVERY surface in the scene that the
laser line can fall upon, OR do a second render pass (possibly reading the
Z-buffer) to apply the laser line effect.

Which of these seems more feasible to you based on the preconditions and
restrictions of your existing app and scene graph architecture?

On Wed, May 29, 2019 at 6:22 PM Matheus Santos 
wrote:

> Something like that:
>
> https://www.researchgate.net/profile/Jan_Albiez/publication/283269557/figure/fig6/AS:668780564865037@1536461120832/Screenshot-of-the-simulation-with-an-active-FlatFish-using-the-laser-line-projectors.ppm
> ...
>
> Thank you!
>
> Cheers,
> Matheus
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=76147#76147
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Forensics • Imaging • UAVs • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] How to implement a Laser Simulation?

2019-05-29 Thread Matheus Santos
Something like that:
https://www.researchgate.net/profile/Jan_Albiez/publication/283269557/figure/fig6/AS:668780564865037@1536461120832/Screenshot-of-the-simulation-with-an-active-FlatFish-using-the-laser-line-projectors.ppm
... 

Thank you!

Cheers,
Matheus

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





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