Hi Sebastien,

I am sorry to bother you but did you work or are you still plannning to work on 
the aspect we talked in this thread ?

Actually I did implement part of it in my project, and recently merged the changes back into osgOcean SVN trunk. The change is that the ocean surface is now under a MatrixTransform called _oceanTransform which is under the OceanScene, instead of being a straight child.

The problem is that I didn't expose any setter/getter for the MatrixTransform's Z height in OceanScene. I was getting to it, but didn't need it quite yet in my own projects, so it was lower on my priority list. If you want to add it, it should be pretty easy. Here's what you'll need to do:

1. void setOceanSurfaceHeight(double height)
1a. will set the _oceanTransform to a translation matrix with height in Z.
  1b. will set _isDirty = true;
2. OceanScene::init() will need to set the clip planes for reflection and refraction to Z = _oceanTransform.getTrans().z() + _oceanSurface->getSurfaceHeight() 3. Also add a getter double getOceanSurfaceHeight() const that returns _oceanTransform.getTrans().z()

Once you've done that, you should be able to call setOceanSurfaceHeight(someValue) and it should work well. Also you could add keys to the OceanScene event handler to be able to change the height interactively (perhaps '+' to raise it, '-' to lower would be nice).

Let me know how that works for you, and if you get something that works well, send me the changes and I'll merge them in.

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-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

Reply via email to