Hi,
I'm implementing a lidar scanner simulator ins osg and got kind oft stucked.
I'm loading a world from file as my scene and let my sensor fly through the
world, everything works fine. From a 3d Party I got a Vertex- and Fragment
Shader to calculate the actual view of the lidar scanner.
In other words what I get right now is an image with colored Pixel
-the color of a pixel tells me the distance between the sensor and point of
object hit by the laser ray
-the image doesent have any depth informations
-when I get the distance-values I have to send them vie ethernet (not relevant
here cause already implemennted) so waht I need as result ist a vector of
long-values including the length of the laser rays
And now I don't know how I can get the distance or better I don't know how I
can get the RGB-Values of the Pixel in the image. (notice that image doesen't
mean I get an Image-object but the actual picture shown in the View)
I tried to realize it via osg::Image:
Code:
osg::Image* buffer = new osg::Image;
...
void getBuffer()
{
buffer->readPixels(0,0,200,200,GL_RGB,GL_FLOAT);
float* bufferRaw;
bufferRaw = (float*) buffer->data();
...
}
With this I just get a wrong value (something undefined like -4.3160208e+008)
I have no idea if I am on the right way or totally wrong. I'm just new to OSG.
So can anyone give me a tip what I should try or for what to search ...
I'm using OSG 2.8.1, have one View and one Camera (the one the view got by
default) and I'm using a kind of complex class hierarchie (ie: I have a
cameraView-clas which realizes the view, and I have a lidarView-class which
realizes the lidar stuff and calls the shaders and which inherits from the
cameraView).
Thank you!
Cheers,
Diana
PS:
The worst ist that it hast to be very fast. I have to write a real-time lidar
scanner simulation.[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41378#41378
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org