Re: [osg-users] SetImage problem

2010-05-31 Thread J.P. Delport

Hi,

On 01/06/10 07:48, Ulrich Hertlein wrote:

Hi Osman,

On 29/05/10 23:38 , Osman Hancer wrote:

then converted BGR to RGB color format by

cvCvtColor( cvImg, cvImg, CV_BGR2RGB );

then I used setImage to do the actual conversion.
osgImg->setImage(cvImg->width,cvImg->height, 3, GL_RGB, GL_RGB,
GL_UNSIGNED_BYTE,(BYTE*)(cvImg->imageData),osg::Image::AllocationMode::NO_DELETE
 ,1);


The line-offset (skew) could indicate that the image is stored as 4-bytes 
per-pixel (not
three, as indicated by RGB) in the OpenCV image.

You're specifying r=3, is this correct?  Do you have three layers?


as Ulrich said, r is the depth for a 3D texture, not the depth ito 
colour layers. Make this 1 and check again.


Also, you can flip the image by just flipping texture coordinates in OSG 
and therefore skip some CPU processing. Also, check if your GPU can 
directly take BGR textures, it should.


jp



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



--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] Trying to render an ortogonal scene

2010-05-31 Thread J.P. Delport

Hi,

see below...

On 31/05/10 22:58, José Carlos Ruiz wrote:

Hi community!

I'm José Carlos. Since a few months I'm using OSG, but now I've a problem 
trying to render a scene with a orthogonal view.

There are not problems with Perspective or Frustrum, but when I change to 
ortogonal the scene doesn't shows nothing.

Here's the code!


//Loading the model
osg::ref_ptr  scene = 
osgDB::readNodeFile("t72-tank\\t72-tank_des.flt");
osg::ref_ptr  posicion = new 
osg::PositionAttitudeTransform;
posicion->addChild(scene);
posicion->setPosition(osg::Vec3d(0.0,0.0,10.0));
posicion->setScale(osg::Vec3d(0.025,0.025,0.025));

 osg::ref_ptr  group = 
dynamic_cast(posicion.get());

 if (!group)
 {
 group = new osg::Group;
 group->addChild(scene.get());
 }


Don't you want to add "posicion" to group here?



//Modelview and projection config.
osg::ref_ptr  viewer = new osgViewer::Viewer;
viewer->getCamera()->setViewport(new osg::Viewport(0.0, 0.0, 1920.0, 
1080.0));

//viewer->getCamera()->setProjectionMatrixAsFrustum(-2.0,2.0,-2.0,2.0,5.0,50.0);
viewer->getCamera()->setProjectionMatrixAsOrtho(-2.0,2.0,-2.0,2.0,5.0, 
50.0);


Try with some larger values than 2 if your model is bigger.

rgds
jp



viewer->getCamera()->setReferenceFrame(osg::Transform::RELATIVE_RF);
viewer->getCamera()->setViewMatrix(osg::Matrix::identity());

viewer->getCamera()->setViewMatrixAsLookAt(osg::Vec3d(0, 0, -10), 
osg::Vec3d(0, 0, 10), osg::Vec3d(0,-1,0));

viewer->setSceneData(group.get());

viewer->addEventHandler(new PickHandler(updateText.get()));

viewer->realize();

while (!viewer->done()){
viewer->frame();
}

return 0;


Thanks in advance! Regards!

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





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] How to add an alpha channel as average of RGB values?

2010-05-31 Thread J.P. Delport

Hi,

have a look at the render to texture examples (grep for "attach"). You 
create an RTT camera, attach your RGB texture as input, create an RGBA 
output texture and attach this as the output, then in a shader do your sums.


jp

On 31/05/10 18:15, alessandro terenzi wrote:

I have an Image coming from a texture, and I'd like to add an alpha
channel with values that are an average of the corrensponding pixel RGB
values. Is there any example that could help?

Thanks.
Alessandro



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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] SetImage problem

2010-05-31 Thread Ulrich Hertlein
Hi Osman,

On 29/05/10 23:38 , Osman Hancer wrote:
> then converted BGR to RGB color format by
> 
> cvCvtColor( cvImg, cvImg, CV_BGR2RGB );
> 
> then I used setImage to do the actual conversion.
> osgImg->setImage(cvImg->width,cvImg->height, 3, GL_RGB, GL_RGB,
> GL_UNSIGNED_BYTE,(BYTE*)(cvImg->imageData),osg::Image::AllocationMode::NO_DELETE
>   ,1);

The line-offset (skew) could indicate that the image is stored as 4-bytes 
per-pixel (not
three, as indicated by RGB) in the OpenCV image.

You're specifying r=3, is this correct?  Do you have three layers?

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


Re: [osg-users] SetImage problem

2010-05-31 Thread Ümit Uzun
Selam Osman,

Did you try void osg::Image::setOrigin (
Origin
  *origin*  )  [inline]function before convert TopLeft image to BottomLeft?
May be you won't need any flipping operation before setImage funtion. And
another hint, are you sure your captured image's depth is IPL_DEPTH_8U from
OpenCV. You have set GL_UNSIGNED_BYTE to image type but may be your type
could be IPL_DEPTH_16U or IPL_DEPTH_32U.

Hope this helps.
Regards.

Ümit Uzun


2010/5/29 Osman Hancer 

> Hi,
>
> I want to convert an OpenCV IplImage to an OSG image. For this, I first
> fliped image from top-left to bottom-left by
>
> cvConvertImage(cvImg , cvImg, CV_CVTIMG_FLIP);
>
>
> then converted BGR to RGB color format by
>
> cvCvtColor( cvImg, cvImg, CV_BGR2RGB );
>
>
> then I used setImage to do the actual conversion.
>
> osgImg->setImage(cvImg->width,cvImg->height, 3,
>GL_RGB, GL_RGB,
> GL_UNSIGNED_BYTE,(BYTE*)(cvImg->imageData),osg::Image::AllocationMode::NO_DELETE
>,1);
>
>
> The result is not what I expected. First of all, the result is in Greyscale
> and image seems to shifted a little bit. You can see the results form the
> attached picture.
>
> Do you have any idea about the problem?
>
> Thank you!
>
> Cheers,
> osman
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=28335#28335
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/_700.jpg
>
>
> ___
> 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] Modifying scenegraph and update

2010-05-31 Thread Jimmy Lin
Hi,

On relative issue.

What if viewer->frame() is running on different thread that is different to the 
thread that modifies the scene graph. In that case I don't really have the 
control when is frame() get called. the modification can happen during the 
rendering time, which I guess is bad.

I tried use lock/unlock wrap around frame() and where ever I modify the scene, 
but this introduce serious performance issue.

The only solution I can think of is use UpdateCallback. but wouldn't the same 
problem happens when modify the update callback at the same time as frame() 
doing the updatetraversal? or does OSG have a way to protect the data during 
the updatetraversal ??

Or is there other approach you can advice me.


Thank you!

Cheers,
Jimmy

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





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


[osg-users] Trying to render an ortogonal scene

2010-05-31 Thread José Carlos Ruiz
Hi community!

I'm José Carlos. Since a few months I'm using OSG, but now I've a problem 
trying to render a scene with a orthogonal view.

There are not problems with Perspective or Frustrum, but when I change to 
ortogonal the scene doesn't shows nothing.

Here's the code!


//Loading the model
osg::ref_ptr scene = 
osgDB::readNodeFile("t72-tank\\t72-tank_des.flt");
osg::ref_ptr posicion = new 
osg::PositionAttitudeTransform;
posicion->addChild(scene);
posicion->setPosition(osg::Vec3d(0.0,0.0,10.0));
posicion->setScale(osg::Vec3d(0.025,0.025,0.025));

osg::ref_ptr group = dynamic_cast(posicion.get());

if (!group)
{
group = new osg::Group;
group->addChild(scene.get());
}

//Modelview and projection config.
osg::ref_ptr viewer = new osgViewer::Viewer;
viewer->getCamera()->setViewport(new osg::Viewport(0.0, 0.0, 1920.0, 
1080.0));

//viewer->getCamera()->setProjectionMatrixAsFrustum(-2.0,2.0,-2.0,2.0,5.0,50.0);
 
viewer->getCamera()->setProjectionMatrixAsOrtho(-2.0,2.0,-2.0,2.0,5.0, 
50.0);

viewer->getCamera()->setReferenceFrame(osg::Transform::RELATIVE_RF);
viewer->getCamera()->setViewMatrix(osg::Matrix::identity());

viewer->getCamera()->setViewMatrixAsLookAt(osg::Vec3d(0, 0, -10), 
osg::Vec3d(0, 0, 10), osg::Vec3d(0,-1,0));

viewer->setSceneData(group.get());

viewer->addEventHandler(new PickHandler(updateText.get()));

viewer->realize();

while (!viewer->done()){
viewer->frame();
}

return 0;


Thanks in advance! Regards!

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





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


[osg-users] SetImage problem

2010-05-31 Thread Osman Hancer
Hi,

I want to convert an OpenCV IplImage to an OSG image. For this, I first fliped 
image from top-left to bottom-left by 

cvConvertImage(cvImg , cvImg, CV_CVTIMG_FLIP);


then converted BGR to RGB color format by

cvCvtColor( cvImg, cvImg, CV_BGR2RGB );


then I used setImage to do the actual conversion.

osgImg->setImage(cvImg->width,cvImg->height, 3,
GL_RGB, GL_RGB, 
GL_UNSIGNED_BYTE,(BYTE*)(cvImg->imageData),osg::Image::AllocationMode::NO_DELETE
,1);


The result is not what I expected. First of all, the result is in Greyscale and 
image seems to shifted a little bit. You can see the results form the attached 
picture.

Do you have any idea about the problem?

Thank you!

Cheers,
osman

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




Attachments: 
http://forum.openscenegraph.org//files/_700.jpg


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


Re: [osg-users] [build] Issues with OSG Freetype Dependency Under Linux

2010-05-31 Thread Carlo del Mundo
Hi Skylark,

That helps a lot! I appreciate your responesI'll try that out in the next 
few hours, but I'm more confident now.

Carlo

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





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


Re: [osg-users] [build] Issues with OSG Freetype Dependency Under Linux

2010-05-31 Thread Jean-Sébastien Guay

Hi Carlo,


Thanks for the quick response.  You are correct! A quick peek in the 
/usr/local/lib/osgPlugins-2.8.3/ folder reveals that freetype is NOT installed.


Just to be precise, what you see in osgPlugins- are OSG 
plugins. So if you don't see osgdb-freetype* in there, it means that OSG 
doesn't have the freetype plugin. Freetype can still be installed on 
your system, but OSG won't be able to load truetype fonts (which is what 
the OSG freetype plugin does).



I've traversed the OpenSceneGraph documentation/Starting Guide but could not 
find any information on how to compile these dependencies.  They also show 
links to the developer sites.

Is there a flagging option in CMake when I build OSG from source? If so, could 
you direct me in the right direction in installing these dependency plugins?


If you have the headers+libs installed on your system (i.e. the freetype 
-dev package) CMake will detect them and include the freetype plugin in 
your build when it generates build files (makefiles, project files, 
etc). It's the same for any optional dependency - CMake has to detect 
that you have the necessary third-party dependency (headers+libs) for 
that plugin to be included in the build. There is no explicit 
enable/disable flag (other than manually typing in the paths to the 
headers+libs).


On Linux, since headers and libs get installed in system-wide places, 
CMake can autodetect the dependencies easily. If you have installed the 
3rd party dependency in a non-standard place (for example in your $HOME) 
you can enable "show advanced variables" in ccmake and type in the paths 
manually. On Windows, a set of standard paths can be searched but we 
often need to put in paths manually since there's no system-assigned 
"standard" place to put headers and libs.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] Issues with OSG Freetype Dependency Under Linux

2010-05-31 Thread Carlo del Mundo
Hi Skylark,

Thanks for the quick response.  You are correct! A quick peek in the 
/usr/local/lib/osgPlugins-2.8.3/ folder reveals that freetype is NOT installed. 
 

I've traversed the OpenSceneGraph documentation/Starting Guide but could not 
find any information on how to compile these dependencies.  They also show 
links to the developer sites.  

Is there a flagging option in CMake when I build OSG from source? If so, could 
you direct me in the right direction in installing these dependency plugins?

Thanks again!

Carlo

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





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


Re: [osg-users] [build] Issues with OSG Freetype Dependency Under Linux

2010-05-31 Thread Jean-Sébastien Guay

Hi Carlo,


According to yum, FreeType is already installed.

Code:
Package freetype-2.2.1-21.el5_3.i386 already installed and latest version


Remember that to be able to build anything with it, the -dev package 
needs to be installed too... Otherwise you just have the shared libs 
installed (so other programs already linked to it can run) and not the 
headers or libraries (needed to build and link to it).


And since OSG's freetype support is in a plugin, all of which are 
optional, your build of OSG is probably not building it. Check if you 
have an osgPlugin-freetype something or other in your 
osgPlugins- directory after you build, my guess is no.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] How to add an alpha channel as average of RGB values?

2010-05-31 Thread alessandro terenzi
I have an Image coming from a texture, and I'd like to add an alpha channel
with values that are an average of the corrensponding pixel RGB values. Is
there any example that could help?

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


[osg-users] [build] Issues with OSG Freetype Dependency Under Linux

2010-05-31 Thread Carlo del Mundo
Hello!

I've spent quite some time figuring out this dependency issue.  Whenever I view 
the sample cow.osg program and press the key 'h,' I receive the following 
problem in std::cout (console):


Code:

Warning: Could not find plugin to read objects from file 
"/home/carlodm/Desktop/OpenSceneGraph-Data/fonts/arial.ttf".



I've spent some time verifying if I have the dependencies listed, and according 
to my search, the FreeType plugin must be installed.  

According to yum, FreeType is already installed.


Code:
Package freetype-2.2.1-21.el5_3.i386 already installed and latest version




Is there anything that I'm missing? Here are information about my build system:


Code:
CentOS 5.5
OSG_FILE_PATH=:/home/carlodm/Desktop/OpenSceneGraph-Data:/home/carlodm/OpenSceneGraph-Data/Images:/home/carlodm/Desktop/OpenSceneGraph/
USER=root
LD_LIBRARY_PATH=:/home/carlodm/Desktop/OpenSceneGraph/lib:/usr/local/lib/osgPlugins-2.8.3:/usr/local/lib
PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/carlodm/Desktop/OpenSceneGraph/bin:/home/carlodm/Desktop/OpenSceneGraph/examples:/root/bin




I have installed OpenSceneGraph from source.

Thank you! Please let me know if you need more information.

Carlo

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





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


Re: [osg-users] problem in changing view from perspective to orthographic

2010-05-31 Thread Robert Osfield
Hi Nitin,

There isn't really any proper way to convert between orthographic and
perspective projections, the two are essentially incompatible
projections.

You can try to make best mappings based the eye point, center of
rotation and your field of view in perspective, which makes the scene
look kinda like it's equivalent, but in the end it's not and you'll
likely ended up bitten eventually by trying to make the two more
alike.

Personally I'd recommend not trying to mix and match perspective and
orthographic projections, use each for their own strengths -
perspective for 3D views of the scene, and orthographic for plan/map
views, side views, etc.

Robert.

On Mon, May 31, 2010 at 4:22 PM, Nitin Rangari
 wrote:
> hi all,
>         i am trying to change Projection matrix from perspective to
> Orthographic
>         i am not finding proper way to do that..
>         i am trying..
>
>          void GraphicsScene::makeOrtho()
>        {
>        osg::BoundingSphere bs = mRootNode->getBound();
>           double h= _gw->getTraits()->height;
>           double w= _gw->getTraits()->width;
>           double aspectratio=w/h;
>           double width = bs.radius()* 1.2;
>            double height = bs.radius()*1.2;
> i       f(width>height)
>       {
>           aspectratio=width/height;
>
>  getCamera()->setProjectionMatrixAsOrtho(-width*aspectratio,width,-height*aspectratio,height,1.0,1.0);
>        }
>       else
>      {
>        aspectratio=height/width;
>
>   getCamera()->setProjectionMatrixAsOrtho(-width*aspectratio,width*aspectratio,-height,height,1.0,1.0);
>        }
> }
> regards ,
> Nitin
> ___
> 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] mouse handling

2010-05-31 Thread Gordon Tomlinson
I suggest reading this before posting any other questions

 

http://catb.org/~esr/faqs/smart-questions.html

 

 


__

Gordon Tomlinson 




 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Manjeet
Sudhanshu
Sent: Monday, May 31, 2010 8:51 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] mouse handling

 

How to pick a vertex of any triangle by mouse.



__ Information from ESET NOD32 Antivirus, version of virus signature
database 5157 (20100531) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

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


Re: [osg-users] Fwd: How to pick a vertex of quad by mouse

2010-05-31 Thread Gordon Tomlinson
I suggest reading this before posting any other questions

 

http://catb.org/~esr/faqs/smart-questions.html

 

 


__

Gordon Tomlinson 



 


__

 

From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of manjeet
sudhanshu
Sent: Monday, May 31, 2010 8:44 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Fwd: How to pick a vertex of quad by mouse

 


How to pick a vertex of quad by mouse


 

-- Forwarded message --
From: manjeet sudhanshu 
Date: Mon, May 31, 2010 at 4:26 PM
Subject: How to pick a vertex of quad by mouse
To: osg-users@lists.openscenegraph.org




 

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


[osg-users] problem in changing view from perspective to orthographic

2010-05-31 Thread Nitin Rangari
hi all,

i am trying to change Projection matrix from perspective to
Orthographic
i am not finding proper way to do that..
i am trying..

 void GraphicsScene::makeOrtho()
   {
osg::BoundingSphere bs = mRootNode->getBound();
   double h= _gw->getTraits()->height;
  double w= _gw->getTraits()->width;
   double aspectratio=w/h;

  double width = bs.radius()* 1.2;
   double height = bs.radius()*1.2;
 i   f(width>height)
  {
  aspectratio=width/height;

 
getCamera()->setProjectionMatrixAsOrtho(-width*aspectratio,width,-height*aspectratio,height,1.0,1.0);
   }
  else
 {
   aspectratio=height/width;

  
getCamera()->setProjectionMatrixAsOrtho(-width*aspectratio,width*aspectratio,-height,height,1.0,1.0);
   }
 }
regards ,
Nitin
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] FBX plugin and Y-up/Z-up...

2010-05-31 Thread Alessandro Terenzi
It looks like that models exported with either the Y-up or Z-up option are 
displayed always in the same way (Z-up). I'm using OSG 2.9.8 and FBX SDK 2011.2 
(models exported from 3dsMax - FBX Plugin 2011.2).

Cheers,
Alessandro

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





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


[osg-users] gDebugger see memory leaks in 14 lines of set up code when FBOs are used

2010-05-31 Thread Sam Warns
Hi,

I spent the whole day chasing a weird memory leak on my GPU. 
The following code is part of a (not working well) FBO render solution.


Code:

#include 
#include 


void foo()
{
   osg::ref_ptr c = new osg::Camera();

   c->setCullingMode(osgUtil::CullVisitor::VIEW_FRUSTUM_CULLING);  // Disable 
SMALL_FEATURE_CULLING
   c->setComputeNearFarMode(osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR);
   c->setClearColor( osg::Vec4(1.0, 1.0, 1.0, 0.0) ); // default white
   c->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   c->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
   c->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
   c->setRenderOrder(osg::Camera::PRE_RENDER);
   osg::ref_ptr topg = new osg::Group;

   topg->addChild( c);

   osgViewer::Viewer viewer;
   viewer.setSceneData(topg);
   viewer.realize();
   viewer.frame();

}

int main(int argc, char* argv[])
{
   {
  {
 foo();
  }
   }

return 0;
}




When I run this with dDebugger I get  memory leaks.

Call stack:

> 
> osgViewer::GraphicsWindow::makeContextCurrentImplementation - 
> osg55-osgViewerd.dll
> osgViewer::GraphicsWindow::makeContextCurrentImplementation - 
> osg55-osgViewerd.dll
> osgViewer::GraphicsWindow::makeContextCurrentImplementation - 
> osg55-osgViewerd.dll
> osgViewer::GraphicsWindow::makeContextCurrentImplementation - 
> osg55-osgViewerd.dll
> osg::LineSegment::start - osg55-osgd.dll
> osgViewer::GraphicsWindow::makeContextCurrentImplementation - 
> osg55-osgViewerd.dll
> osgViewer::GraphicsWindow::makeContextCurrentImplementation - 
> osg55-osgViewerd.dll
> foo - osg_viewer_leak_test.cpp, line 22
> main - osg_viewer_leak_test.cpp, line 31
> __tmainCRTStartup - crtexe.c, line 597
> mainCRTStartup - crtexe.c, line 413
> RegisterWaitForInputIdle - kernel32.dll
> 


These are two render buffers and one FBO

when I change the 

Code:

 c->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);


from FRAME_BUFFER_OBJECT to FRAME_BUFFER ->

Code:

 ->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER);



No leak occurs.

Win XP Pro, SP 2, GeForce GTX 285, Driver 191.07
gDebugger 5.2.1

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





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


Re: [osg-users] mouse handling

2010-05-31 Thread Jean-Sébastien Guay

Hello Manjeet,


How to pick a vertex of any triangle by mouse.


You already posted that question not once, not twice but three times. 
Plus, Nick gave you a possible solution, and you replied to that message 
by repeating the question in large font. That seems a bit rude to me, so 
please review the guidelines of netiquette. You're more likely to get 
good answers by being polite and patient.


As for your problem, Nick gave you one way which is kind of the "old" 
OpenGL way - selection buffer is not really optimal now as it causes 
stalls in the OpenGL pipeline. Personally, I would do it in one of the 
two following ways:


If you just need any vertex under the mouse when it's clicked (consider 
many overlapping vertices in a small area, which one do you select?) you 
can use osgUtil::PolytopeIntersector with a small polytope centered on 
the mouse location. You can then take for example the vertex closest to 
the viewpoint. But this won't handle occlusion, i.e. it will select 
vertices even through other triangles.


Another way is to do a line segment intersection to find a triangle that 
intersects, and then find the vertex of that triangle that's closest to 
the intersection. Using osgUtil::LineSegmentIntersector will give you, 
in the resulting Intersection object, the triangle that was intersected 
and a ratiolist where ratio i is the contribution of vertex i in the 
triangle to the intersection point. The vertex with the largest ratio is 
the closest.


There are other ways, you can search Google for ideas. These two are 
just off the top of my head.


Hope this helps, and as I said, next time please be patient, this is a 
great community that really wants to help.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] mouse handling

2010-05-31 Thread Manjeet Sudhanshu
How to pick a vertex of any triangle by mouse.

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


[osg-users] Fwd: How to pick a vertex of quad by mouse

2010-05-31 Thread manjeet sudhanshu
How to pick a vertex of quad by mouse

-- Forwarded message --
From: manjeet sudhanshu 
Date: Mon, May 31, 2010 at 4:26 PM
Subject: How to pick a vertex of quad by mouse
To: osg-users@lists.openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] Animate Visibility

2010-05-31 Thread Daniele Cittadini
Hi,

I don't know if this is the right place where to ask this, I hope so.
I'd like to export from 3dsmax a 3d model using the OsgExp plugin.
All works correctly, what I'd like to do is to animate visibility in the way 
that at start frame the object isn't visible and it appears so at frame 30 it 
is 100% full visible.

I've tried to animate both material Opacity and object Visibility but it 
doesn't work.

Thank you in advance for any kind of help.

... 

Thank you!

Cheers,
Daniele

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





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


[osg-users] morph animation

2010-05-31 Thread Daniele Cittadini
hi!

the osgexp plugin for 3dsmax works great.

I'm asking if it's possible to export also not only transform animation 
(translate, rotate, scale) but also morph animation (verteces mesh 
modification).

Thanks a lot.

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





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


Re: [osg-users] How to pick a vertex of quad by mouse

2010-05-31 Thread Trajce (Nick) Nikolov
The way how I did this in the past is, I had the vertices in separate
drawable and used selection buffer. Do a search for selection buffer

-Nick


On Mon, May 31, 2010 at 12:56 PM, manjeet sudhanshu <
sudhanshu.manj...@gmail.com> wrote:

>
>
> ___
> 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


[osg-users] How to pick a vertex of quad by mouse

2010-05-31 Thread manjeet sudhanshu

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


Re: [osg-users] [osgPlugins] FBX plugin: transparency and reflection maps...

2010-05-31 Thread Alessandro Terenzi
I'm am adding support for opacity, reflection and lighting maps to the FBX 
plugin...so far I've got good results and I'm going to post the new code as 
soon as I've reviewed and 'cleaned' it ;) by the way how and where should I 
upload my modifications?

Is there a good repository for FBX models that I could use for testing those 
new features as well as other features in general?

Finally, I noticed that animations based on bones work fine but morphing 
animations makes osganimationviewer to crash, any idea? (I made models with 
3dsMax 2010+FBX 2011.2)

Thanks
Alessandro

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





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


Re: [osg-users] bvh plugin

2010-05-31 Thread Aitor Ardanza
Hi,

I can get the bones as nodes, but I need to know the position and rotation 
matrices of these.


Code:
osg::Node* boneNode = 
checkName(skelroot.get()->asGroup(),animList[0]->getChannels()[i]->getTargetName());



Any help?!
Thank you!

Cheers,
Aitor

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





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


Re: [osg-users] CityGML

2010-05-31 Thread Alexandre Amalric
Hi,

I'm also interested in your submission ;-)

Kind regards,

2010/5/27 Aitor Moreno 

> Hi,
>
> On Wed, Apr 21, 2010 at 10:07 PM, Joachim Pouderoux wrote:
>
>> I have coded a CityGML reader for OSG ! It successfully parses all
>> geometry, material (color & texture) of CityGM 0.3-1.0 samples available on
>> the offical CityGML website.
>> The reader is based on a small library (4 files) I developed which is
>> independent of osg. I should submit the code of both the lib & the reader
>> soon! Stay tuned :)
>>
>
> I wonder if some progress has been made on this topics...
>
> Best regards,
>
> --
> Aitor Moreno
>   aitormoreno [...@] gmail.com
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Alexandre AMALRIC   Ingénieur R&D
===
PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
http://www.pixxim.fr
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] LOD simple textures strategy

2010-05-31 Thread Robert Osfield
Hi Dean,

The OSG doesn't have any scene graph level LOD system specifically for
textures.  The OSG supports mipmapping which is a form of LOD, but I
guess you probably ain't thinking of this.

In terms of best performance you are typically best to reduce the
number vertics, the number of separate osg::Geometry and nodes, and
merge as much state (including textures) as possible as you simplify
the subgraph for each LOD levels.  Just trying to choose a simpler
texture for different LOD level of details is pretty unlikely to help
unless it's an unusual scene graph set up where scene graph complexity
(state, nodes and geometry) is already as simple as it can go and it's
only texture memory that is holding you back.

Robert.

On Sun, May 30, 2010 at 4:09 PM, Dean Bouvier  wrote:
> Hi,
>
> I've been contemplating an LOD system for a project I'm working on, and I'm 
> wondering a few things about textures as they are used by OSG.
>
> Does OSG perform texture scaling of any kind so that it will reduce the size 
> of a texture in memory as an object reduces in scale?
>
> Most of the objects I'm planning to render are either small or fairly simple 
> in detail and could conceivably use a small simple texture for a number of 
> LOD cases, many objects would share this aspect in similar at the same time, 
> would it make sense from a memory use or performance standpoint to have one 
> larger texture which is referenced by all models at certain LOD's instead of 
> having each model using its own small texture?
>
> A good example would be a bunch of primitives representing buildings making 
> up a city.
>
> Thank you!
>
> Cheers,
> Dean
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=28341#28341
>
>
>
>
>
> ___
> 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] [osgPlugins] FBX texture export problem.

2010-05-31 Thread Dario Minieri
Hi,

Thanks for your reply. I tried your trick but the result  seems the same as 
above. Seems strange that nobody else in the forum has the same problem. You've 
encountered this kind of problem?

Some friends also, are having this problem and, as I said earlier, we used both 
version 2.8.3 (with FBXSDK 2010) and svn version (with FBXSDK 2011).

Thanks for any idea :D

Cheers,
Dario



Sukender wrote:
> Hi Dario,
> 
> Maybe the FBX code doesn't use the FBX file's directory as a base dir for 
> textures; try copying the FBX+textures in osgconv's dir for testing. I may 
> (should?) investigate this, but I'm far too busy right now.
> Help, anyone?
> 
> 
> > Hi,
> > 
> > I've a very annoying problem converting an fbx file into an osg
> > through osgconv. The fbx file contains the (correct) refer to a
> > texture (I'm able to correctly show the fbx in my modeling tool and I
> > see the path in the fbx ASCII version...) but when I try the
> > convertion I see those messages error:
> > 
> > Warning: Could not find plugin to read objects from file "".
> > Warning: Could not find plugin to read objects from file "".
> > Warning: Could not find plugin to read objects from file
> > "//Parent/Dir/of/current/path".
> > 
> > The osg file is created, all meshes there are, but no texture. I've
> > tried with both fbx plugin in osg 2.8.3 and current OSG svn build.
> > I've the same problem.
> > 
> > You have some suggestion?
> > 
> > Thank you!
> > 
> > Cheers,
> > Dario
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=28328#28328
> > 
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





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


Re: [osg-users] [osgPlugins] FBX texture export problem.

2010-05-31 Thread Sukender
Hi Dario,

Maybe the FBX code doesn't use the FBX file's directory as a base dir for 
textures; try copying the FBX+textures in osgconv's dir for testing. I may 
(should?) investigate this, but I'm far too busy right now.
Help, anyone?

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

- "Dario Minieri"  a écrit :

> Hi,
> 
> I've a very annoying problem converting an fbx file into an osg
> through osgconv. The fbx file contains the (correct) refer to a
> texture (I'm able to correctly show the fbx in my modeling tool and I
> see the path in the fbx ASCII version...) but when I try the
> convertion I see those messages error:
> 
> Warning: Could not find plugin to read objects from file "".
> Warning: Could not find plugin to read objects from file "".
> Warning: Could not find plugin to read objects from file
> "//Parent/Dir/of/current/path".
> 
> The osg file is created, all meshes there are, but no texture. I've
> tried with both fbx plugin in osg 2.8.3 and current OSG svn build.
> I've the same problem.
> 
> You have some suggestion?
> 
> Thank you!
> 
> Cheers,
> Dario
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=28328#28328
> 
> 
> 
> 
> 
> ___
> 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


[osg-users] [osgOcean] osgOcean unhandled exception error

2010-05-31 Thread Saravanan Sivaprahasam
Hi,

We've compiled the osgOcean sucessfully and the osgExample runs well.

When we quit the application, the compiler vc++ 2008 (express edition) shows an 
unhandled exception

hxxp://img514.imageshack.us/img514/4452/unhandle.jpg


Thank you!

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





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