Re: [osg-users] [3rdparty] change ocean height

2009-10-02 Thread Sebastien Nerig
Hi,

haha ok thx for your answer and bug fix JS, I will try
Well I did apologize because it seems that I am the only one to use the 
osgOcean height features and I do not use to have people working for me ! :p
I tried to correct myself but you were too fast ^^

well thanks anyway

Sebastien

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





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


Re: [osg-users] [3rdparty] change ocean height

2009-10-02 Thread Martin Scheffler
no seb, I also really needed that feature. I already wrapped it in dtOcean: 
https://sourceforge.net/apps/mediawiki/delta3d/index.php?title=DtOcean

Cheers. Martin

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





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


Re: [osg-users] [3rdparty] change ocean height

2009-10-02 Thread Jean-Sébastien Guay

Hello Martin,

no seb, I also really needed that feature. I already wrapped it in dtOcean: 
https://sourceforge.net/apps/mediawiki/delta3d/index.php?title=DtOcean


Wow, I didn't know osgOcean had already made it into Delta3D! Nice!

If there are any features you need for it to integrate better into 
Delta3D, you can ask, we'll put them onto the to-do list :-)


Thanks,

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] [3rdparty] change ocean height

2009-10-02 Thread Jason Daly

Jean-Sébastien Guay wrote:

Wow, I didn't know osgOcean had already made it into Delta3D! Nice!
  


Delta3D is developed at the Naval Postgraduate School.  What did you 
expect?  ;-)


--J


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


Re: [osg-users] [3rdparty] change ocean height

2009-10-01 Thread Sebastien Nerig
Hi JS
ok I have updated osgOcean from the trunk and tried the new 
setOceanSurfaceHeight function.
It is working well.
Except that I have no node reflections in the water ? Did you try it ? 

In my 1st pic you can see the ocean and a cow at altitude 0, the reflection is 
great. 

[Image: http://img43.imageshack.us/img43/8820/water1h.jpg ]

But when I add a (0,0,100) transform node for the cow and I use 
setOceanSurfaceHeight(100), I have no more reflections and a strange artifact 
at the horizon, see pic2

[Image: http://img25.imageshack.us/img25/9372/water2r.jpg ]

Do you confirm this ?

(really sorry to bother you ^^)

Thank you!

Cheers,
Sebastien

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





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


Re: [osg-users] [3rdparty] change ocean height

2009-10-01 Thread Kim Bale
Hi Sebastien,


I think this is because the reflection matrix used by the reflection
FBO doesn't take into account the change in height and is still trying
to reflect the scene across the origin.

I don't have much time to give to osgOcean at the moment so if you
need a fix urgently you should have a go yourself.

It should be pretty easy to sort out, just modify the
_reflectionMatrix variable in OceanScene when the
setOceanSurfaceHeight is modified to reflect across the new ocean
plane.

void setOceanSurfaceHeight(double height){
   _oceanTransform-setMatrix(osg::Matrix::translate(0,0,height));
   _isDirty = true;
}

If you get to it before me, send in the code and I'll merge the fix.


Cheers.


Kim.



2009/10/1 Sebastien Nerig overse...@hotmail.com:
 Hi JS
 ok I have updated osgOcean from the trunk and tried the new 
 setOceanSurfaceHeight function.
 It is working well.
 Except that I have no node reflections in the water ? Did you try it ?

 In my 1st pic you can see the ocean and a cow at altitude 0, the reflection 
 is great.

 [Image: http://img43.imageshack.us/img43/8820/water1h.jpg ]

 But when I add a (0,0,100) transform node for the cow and I use 
 setOceanSurfaceHeight(100), I have no more reflections and a strange artifact 
 at the horizon, see pic2

 [Image: http://img25.imageshack.us/img25/9372/water2r.jpg ]

 Do you confirm this ?

 (really sorry to bother you ^^)

 Thank you!

 Cheers,
 Sebastien

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





 ___
 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] [3rdparty] change ocean height

2009-10-01 Thread Jean-Sébastien Guay

Michael, Kim,


If you get to it before me, send in the code and I'll merge the fix.


I'll do this right away. Give me a few minutes.

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] [3rdparty] change ocean height

2009-10-01 Thread Jean-Sébastien Guay

Hi again,


If you get to it before me, send in the code and I'll merge the fix.


I'll do this right away. Give me a few minutes.


Done and committed to osgOcean SVN trunk. I also added a command line 
parameter to the oceanExample so that you can experiment with the ocean 
surface height. So for example I tested with:


  oceanExample cessna.osg.(0,-15,90).rot.(0,200,115).trans
--oceanSurfaceHeight 100

(which uses the cessna.osg model from OpenSceneGraph-Data and positions 
it 115 meters in the air, and places the ocean surface at 100 meters)


Hope this helps, and sorry for forgetting the reflection matrix when I 
added ocean surface height control...


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] [3rdparty] change ocean height

2009-10-01 Thread Sebastien Nerig
Hi all,

Thanks for your rapidity !!

So I have updated and tested with my scene, when the cow is at 150 and the 
ocean at 100, it works well (the reflection is hard to see but it is here !)
[Image: http://img246.imageshack.us/img246/9285/sanstitre1yg.jpg ]

But ... really sorry again... there is a problem when the cow touches the 
ocean, both of them are at height 100... do you confirm this ?
[Image: http://img297.imageshack.us/img297/836/sanstitre2hs.jpg ]


Cheers,
Sebastien

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





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


Re: [osg-users] [3rdparty] change ocean height

2009-10-01 Thread Jean-Sébastien Guay

Hi Sebastien,


So I have updated and tested with my scene, when the cow is at 150 and the 
ocean at 100, it works well (the reflection is hard to see but it is here !)
[Image: http://img246.imageshack.us/img246/9285/sanstitre1yg.jpg ]


If you lower the cow or lower your point of view you'll see the 
reflection becomes clearer. The intensity of reflection depends on the 
angle of the reflected view vector.



But ... really sorry again... there is a problem when the cow touches the 
ocean, both of them are at height 100... do you confirm this ?
[Image: http://img297.imageshack.us/img297/836/sanstitre2hs.jpg ]


Hmmm, my setting of the clip node would be wrong. I'll test it out.

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] [3rdparty] change ocean height

2009-10-01 Thread Jean-Sébastien Guay

Hi Sebastien,


But ... really sorry again... there is a problem when the cow touches the 
ocean, both of them are at height 100... do you confirm this ?
[Image: http://img297.imageshack.us/img297/836/sanstitre2hs.jpg ]


Yep, that was it. Simple fix. Sorry about that.

Note that the reflections are clipped to a plane, but the ocean surface 
is not a plane (which is the whole point of osgOcean... :-) ) so there 
are some points where if the waves are really high the reflection will 
be missing on part of it. It's either that or have reflections popping 
up behind objects as you saw, so it's a lesser of two evils situation...


And please don't apologize about reporting bugs, we have to find these 
bugs! I don't use these features in our other projects here, so other 
users like you are the only source of testing... If you want you can 
always try to fix them and send us the fixes, but I will never say Oh 
no, not another bug report... Damn, osgOcean's software quality is 
getting way too high... I wish these bug reports would stop and the bugs 
would just stay there... ... :-)


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] [3rdparty] change ocean height

2009-09-30 Thread Sebastien Nerig
Hi Jean-Sébastien,

ok thanks a lot for yours answers, I will work on it et keep in touch
Thank you again

Sebastien

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





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


Re: [osg-users] [3rdparty] change ocean height

2009-09-29 Thread Sebastien Nerig
Hi Jean 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 ?

Thank you

Sebastien

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





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


Re: [osg-users] [3rdparty] change ocean height

2009-09-29 Thread Jean-Sébastien Guay

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 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] [3rdparty] change ocean height

2009-09-29 Thread Jean-Sébastien Guay

Hi again 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 ?


Well, I had some downtime while I waited for a big project to compile, 
so I decided to go ahead and do it. If you're using osgOcean SVN trunk, 
just update and you'll have the new methods in OceanScene.


It works well, but with the skybox images that come with osgOcean, if 
you lower the ocean surface past a certain point you'll start seeing 
black. That's because the skydome images are cut off below the normal 
horizon, which should generally be z=0. This was not visible before, but 
now since we can lower the ocean, we can see it. I'll probably just 
modify the images so they have the same color as the last valid line 
below the normal horizon.


You shouldn't see this problem in your own apps if you make a normal 
skydome/skybox where all sides can potentially be visible.


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] [3rdparty] change ocean height

2009-09-29 Thread Jean-Sébastien Guay

Hi again,

It works well, but with the skybox images that come with osgOcean, if 
you lower the ocean surface past a certain point you'll start seeing 
black. That's because the skydome images are cut off below the normal 
horizon, which should generally be z=0. This was not visible before, but 
now since we can lower the ocean, we can see it. I'll probably just 
modify the images so they have the same color as the last valid line 
below the normal horizon.


Err, sorry, I was mixed up with another project of mine. The 
oceanExample uses a skydome and not a skybox, but it's still the source 
of the black line you'll start seeing as you lower the ocean surface, 
because the dome only exists above z=0. I'll see about fixing that so 
the example looks better with the ocean surface at a height of less than 0.


Sorry for the confusion...

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] [3rdparty] change ocean height

2009-09-03 Thread Jean-Sébastien Guay

Hello Sebastien,


I would like to know if there is a way to change the ocean surface height.
All the objects of my scene are located at a 100 altitude on the Z axis while 
the ocean is a 0.


I have some local modifications to osgOcean to allow this, but I am on 
vacation right now so I will not be able to review + check in the 
changes for another two weeks or so. As soon as I get back to work I'll 
make sure the changes are checked in and send you an update.


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] [3rdparty] change ocean height

2009-09-03 Thread Sebastien Nerig
Hi JS

bad luck for me ! ^^
anyway thanks for your answer and have nice holidays :)

sebastien

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





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