Re: [osg-users] [osgPlugins] Collada dae plugin for Android OSG

2012-09-21 Thread Oren Fromberg
Dear Jorge and Jan,

Thanks for your replies... Coincidentally, I initially argued the same point 
you are both making to my software lead (who is monitoring this thread)  that 
it would be better to export assets to OpenSceneGraph's native data format. He 
argued in turn that it is important for our platform to be able to load Collada 
files so that 3rd parties can easily load their own assets without having to 
export them to .ive or .osgb.

Hope you both enjoy the weekend.

Oren


Jorge Izquierdo Ciges wrote:
 Jan I agree totally with you. For mobile devices, Android specifically binary 
 file formats tend to work a lot better than plain text derivates that's one 
 of the reason collada was not in my to do list whe we worked on making OSG 
 work in Android. Still, there are projects where you can't take smart optimal 
 decisions and would be cool to know that teorical is works xD
 
 Happy weekend!.
 
 2012/9/21 Jan Ciger  ()
 
   
  On Fri, Sep 21, 2012 at 9:35 AM, Jorge Izquierdo Ciges  () wrote:
  
I can't recommend none of them, it's a specific case that wasn't in the 
   things to do list. If there is already a version ported or prepared to 
   be used in Android then maybe just for the sake of your own sanity  I 
   would test it. If it works cool, if not... well look into other 
   possibilities. In the root Android is a hyped/javaticed linux with a like 
   for tough compilings but still compatible with the vast majority of the 
   C/C++ source code of open libraries. In the end it's just a matter of 
   time, work and study of the platform, except rare cases.  So... as some 
   books say, Have a go hero! 
   
   And check out with the mail list with your results.
   
   
   
  
  
  While it should be possible to compile the COLLADA DOM for Android, I think 
  Oren would be better off with using another data format. COLLADA is quite a 
  mess of a format, intended for exchange of data between modelling tools, 
  not as an end-user deployment format. You get huge XML files, not 
  something I would want on a mobile device. 
  
  Use COLLADA to export your stuff from 3DS Max/Blender/Maya (native OSG 
  exporters are better, though) and convert it to e.g. .ive or .osgb for use 
  on the mobile. Smaller files, everything included (textures, shaders, 
  etc.), faster loading - a win-win situation. 
  
  Regards,
  
  Jan
  
  
  
  ___
  osg-users mailing list
   ()
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
  (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=50235#50235





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


[osg-users] [osgPlugins] Collada dae plugin for Android OSG

2012-09-20 Thread Oren Fromberg
Hey everyone,

I want to use the collada plugin for my Android app. So I started here:

http://www.openscenegraph.org/projects/osg/wiki/Support/KnowledgeBase/Collada

This page, which seems a bit outdated, pointed me to use the DOM project here 
(which is at version 2.2): 

http://sourceforge.net/projects/collada-dom/files/Collada%20DOM/Collada%20DOM%202.2/

The problem is that this library has a directory with prebuilt binaries for 
almost every platform except Android. I suppose this means I would have to 
build these libraries for Android before I use this version of Collada...

However, over at https://android.googlesource.com/ there is a version of 
Collada that already has an Android.mk.

My question: What should I do? spend time on trying to build the prereq libs in 
Collada DOM and get the standard version working OR try to integrate the 
version of Collada DOM that is provided by the Android git repo's?

Thanks!

TL;DR: what is easier? trying to build prereq libs OR trying to integrate 
different lib into plugin?

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





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


Re: [osg-users] Real3D on LG Optimus with OpenSceneGraph 3.0.0

2012-09-11 Thread Oren Fromberg
Thanks Robert and Rafa,

Looks I had set the display settings on the viewer correctly but I was not 
actually rendering with the main camera in the scene graph, I only had an 
ortho2d camera rendering a HUD underneath the root node.
Once I had placed some geometry underneath the root node to be rendered by the 
perspective camera, the stereoscopic display worked properly.
When I set the display settings for the ortho2d camera to do stereo, it still 
did not work. Is that because ortho cameras do not support stereo? thinking 
about it hurts my head a bit, since ortho does not have a focal point...
I ended up creating another camera for the HUD that simply renders everything 
into the other half of the viewport.

Thanks

-Oren

Ps. Thanks Rafa for referring me to your interesting project, I will definitely 
check out!

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





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


[osg-users] Real3D on LG Optimus with OpenSceneGraph 3.0.0

2012-09-07 Thread Oren Fromberg
I am trying to enable stereoscopic rendering in the osg display settings in 
order to use the stereoscopic display on the LG optimus. The LG Real3D API 
expects the framebuffer to be split horizontally so I am enabling stereo 
rendering like this:


Code:
osg::DisplaySettings::instance()-setStereo(true);
osg::DisplaySettings::instance()-setStereoMode(osg::DisplaySettings::HORIZONTAL_SPLIT);




but it doesn't seem to be working. 

What could be the reason for it not working? 

Are there any caveats to using the DisplaySettings to enable stereo at a low 
level? 

Should I go the way of using two slave cameras and render in two separate 
viewports in the framebuffer?

thanks!

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





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


Re: [osg-users] Real3D on LG Optimus with OpenSceneGraph 3.0.0

2012-09-07 Thread Oren Fromberg
well, I stepped through the code in DisplaySettings.cpp and setting those 
environment variables does the exact same thing as the function calls.

also, I am not sure how to set environment variables in android so I don't know 
how to test it.

I want to understand how the rendering changes at the low level when display 
settings have stereo enabled.

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





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


[osg-users] Framerate Capping in 2.8.2

2012-03-01 Thread Oren Fromberg
Hi all,

Here we use osg 2.8.2 and have a requirement to cap the framerate in certain 
cases. We found that doing the following caused us to barely reach the 
framerate limit, so instead of hitting 30 fps it was around 28.X fps.


Code:
while(!viewer.done())
{
  osg::Timer_t startFrameTick = osg::Timer::instance()-tick();

  viewer.frame();

  osg::Timer_t endFrameTick = osg::Timer::instance()-tick();
  double frameTime = osg::Timer::instance()-delta_s(startFrameTick, 
endFrameTick);
  OpenThreads::Thread::microSleep(static_castunsigned 
int(0.95*100.0*(minFrameTime-frameTime)));
  if (frameTime  minFrameTime) 
OpenThreads::Thread::microSleep(static_castunsigned 
int(100.0*(minFrameTime-frameTime)));
}




however the following code lets us hit exactly 30.0 fps or whatever we ask:


Code:

void CustomViewer::frame(double simulationTime)
{
  if (_done) return;

  float fpsLimit = 30.0;
  osg::Timer_t currentTime = osg::Timer::instance()-tick();
  if (osg::Timer::instance()-delta_s(lastFrameTime, currentTime)  (1.0 / 
fpsLimit)) 
return;
  lastFrameTime = currentTime;

  if (_firstFrame)
{
  viewerInit();
  if (!isRealized()) realize();
  _firstFrame = false;
}

  advance(simulationTime);
  
  eventTraversal();
  updateTraversal();
  renderingTraversals();
}




any thoughts or comments about why this is the case? Also, does the constant 
spinning in the second example mess with OSG multithreading?

thank you!

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





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


[osg-users] Fixing Z-Fighting in Far Field...

2011-07-29 Thread Oren Fromberg
Howdy everyone,

I have objects under a group node called Objects that are rendered. When the 
objects get too far away, Z-fighting occurs. Would it be possible to fix the 
Z-fighting by instead of adding the objects as a child of Objects, create two 
camera nodes as children to Objects (farCam and NearCam) and adding the 
objects to either camera based on its range to the eyepoint? the farCam and 
nearCam would be identical except zNear and zFar for the projection. Would I 
need to make any additional settings in the cameras for this to work?

Thanks!

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





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


Re: [osg-users] osg::ProxyNode and osg::ComputeBoundsVisitor

2011-07-25 Thread Oren Fromberg
Hey Sebastian!

Thanks for the interesting reply. So, I guess that explains why the dimensions 
of my bounding box are tending to infinity! I have some questions though:

1) what do you mean by load the proxy node at least once? does that mean to 
add the proxy node as a child in the scene or just to add a reference to that 
node?

2) what do you mean by hook up in the load callbacks?

3) what does your database compiler do?

Thanks so much!

Sincerely,

Oren

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





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


[osg-users] osg::ProxyNode and osg::ComputeBoundsVisitor

2011-07-20 Thread Oren Fromberg
Howdy friends,

I'm loading a model using an osg::ProxyNode like this:


Code:

std::map std::string, osg::ref_ptrosg::Node  model_db_map;
...
if (model_db_map[name] == NULL)
{
osg::ref_ptrosg::ProxyNode pn = new osg::ProxyNode;
pn-setLoadingExternalReferenceMode 
(osg::ProxyNode::DEFER_LOADING_TO_DATABASE_PAGER);
pn-setFileName (0, name + .ive);
model_db_map[name] = pn;
}




shortly after this I compute the bounding box like this:

Code:

osg::ref_ptrNode node = model_db_map[name];
osg::ComputeBoundsVisitor bb;
node-accept(bb);




problem is I then get this for bb.getBoundingBox()._min:

Code:
(gdb) p bboxMin
$1 = {_v = {3.40282347e+38, 3.40282347e+38, 3.40282347e+38}}



and this for bb.getBoundingBox()._max:

Code:
(gdb) p bboxMax
$2 = {_v = {-3.40282347e+38, -3.40282347e+38, -3.40282347e+38}}



and my stdout gets repeatedly bombed with this:


Code:
CullVisitor::apply(Geode) detected NaN,
depth=nan, center=(0 0 0),
matrix={
nan nan nan nan 
nan nan nan nan 
nan nan nan nan 
nan nan nan nan 
}




Why is this so? The bounding box is computed correctly when using 
osgDB::readNodeFile instead of osg::ProxyNode. Thanks in advance.

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





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


Re: [osg-users] Transforming nodes

2009-12-22 Thread Oren Fromberg
Dear Brendan,

That was absolutely the problem!! Thanks so much for your help.

Sincerely,

Oren

p.s. I wish there was some kind of heads-up in the header file for 
DOFTransform!!

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





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


Re: [osg-users] Transforming nodes

2009-12-21 Thread Oren Fromberg
bump...

I've managed to insert DOFTransform nodes into my model but the geometry under 
these nodes are not being drawn even though the drawable update callbacks are 
definitely being called...

The weird thing is, if I replace the DOFTransform with a simple 
MatrixTransform, the geometry renders just fine.  :? 

If I just leave the put and inverse put matrices as identity matrices, it 
should still render, right? what am I doing wrong??

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





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


[osg-users] incomplete type in gdb

2009-12-14 Thread Oren Fromberg
forgive me if this is a commonly asked question, I checked the archives and 
couldn't seem to find anything...

using gdb, if I try to print the value of objects, I get this error:

(gdb) p tempParent
$1 = (struct osg::Group *) 0xb05178
(gdb) p *tempParent
$2 = incomplete type

how do I fix this so that I can see the object members? Thanks in advance!

Oren :-*

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





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


Re: [osg-users] incomplete type in gdb

2009-12-14 Thread Oren Fromberg
Thanks so much Alberto! wow, I can't believe I didn't figure that out... I went 
to my OpenSceneGraph directory and did a make debug, then su'd and make 
install. then I changed my Makefile to link against the debug libraries I was 
using (-losgSimd and -losgViewerd) and it works great. Thanks again.

Oren :D

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





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


Re: [osg-users] Top 10 OSG Debugging Tips

2009-12-14 Thread Oren Fromberg
This is pretty obvious (I know) but it helps a lot to link with the debug 
libraries... :D

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





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


Re: [osg-users] Transforming nodes

2009-12-07 Thread Oren Fromberg
wow, thank you guys for the great help... DOFTransform seems to be right on the 
money.

Oren

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





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


[osg-users] Transforming nodes

2009-12-03 Thread Oren Fromberg
Hello everyone! Here is my question:

I have a model of a sea faring vessel that has little gadgets on it like 
radars, turrets, propellors, etc. these gadgets are fully contained in separate 
named Geodes. That means that the geometry in the geode is specified relative 
to the origin of the ship and not the point where the gadget is located. what 
is the best way to make these things transform (mainly rotate)?

I was thinking I could parent the gadget Geode with a MatrixTransform node to 
create some kind of local coordinate system for the geometry of the gadget but 
then the geometry itself would have to be respecified relative to this 
geometry. can I somehow put a static transform between the MatrixTransform and 
the Geode in order to offset the positions of all the vertices so that the 
point that the gadget transforms around becomes the location of the 
MatrixTransform?

Thanks in advance for your help! :D

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





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


Re: [osg-users] Transforming nodes

2009-12-03 Thread Oren Fromberg
Thanks for the suggestion... I'll definitely check it out.

my other question is how do I modify the geometry on the gadgets to be located 
around an origin, namely the point around which the gadget transforms? so if my 
gadget is located at point (x,y,z), I want the point of articulation to be at 
(0, 0, 0). I was thinking I could put a transform right above the geode that 
offsets everything by (-x,-y,-z), and somehow use the Optimizer in osgUtils. 
any suggestions?

Thanks again!

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





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