AimplainLeo / osgocean

Automatically exported from code.google.com/p/osgocean
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Add keystrokes to change the ocean surface on the fly #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be nice to be able to change the parameters of the ocean surface
on the fly. Everything that's currently a command line argument (and
possibly more) could be changed by keystrokes ('a' to go one way, 'A' to go
the other way for numeric values, for example).

Then there could be a key to output a text file that would contain the
command line arguments that would reproduce the current ocean surface settings.

This would require minor refactoring of OceanSurface / FFTOceanSurface to
support run-time rebuilding with new settings. I would suggest that
OceanSurface have a virtual getEventHandler() method in which subclasses
would return a class-specific event handler that would have keys for the
parameters that the given OceanSurface sublclass knows about.

Original issue reported on code.google.com by jean.sebastien.guay13@gmail.com on 12 Jun 2009 at 1:48

GoogleCodeExporter commented 9 years ago
I don't know if you've looked at Hydrax yet, but they have a nice ocean scene
designer that saves out a configuration file. It would be a nice to have similar
functionality for osgOcean. But that's quite a substantial bit of work.

Original comment by kcb...@googlemail.com on 12 Jun 2009 at 2:38

GoogleCodeExporter commented 9 years ago
You mean this? http://www.ogre3d.org/wiki/index.php/Hydrax

Very nice. I like their caustics and rendering. No screenshots of their GUI 
editor,
though it's mentioned in the features.

Yes it would be nice to have a GUI editor, but as a first step I think adding
keystrokes would be good.

Original comment by jean.sebastien.guay13@gmail.com on 12 Jun 2009 at 2:45

GoogleCodeExporter commented 9 years ago
This is partly done. The general design for the event handler subclassing is 
in, and
basic properties can be changed. More will go in later.

One thing that would be nice now is to show the current values for the different
properties. This could be a hud, or just print out to the command line window 
(which
I'll do tomorrow as it will probably be enough for the near term).

I'm also thinking that coupling the event handlers so directly to the 
OceanTechnique
subclasses might not be the right choice. After all, the OceanTechniques 
themselves
should have nothing to do with event handling. Maybe having an external event 
handler
factory in which the OceanTechnique subclasses would register their event 
handler
would be a cleaner design. But perhaps I'm overthinking this.

Original comment by jean.sebastien.guay13@gmail.com on 15 Jun 2009 at 2:35

GoogleCodeExporter commented 9 years ago
I just added printing of the new value to the console when you press a key to 
change
a value, as well as a key that prints all current settings to the console.

For now, the current functionality is good enough, so I'll flag this as done.

Original comment by jean.sebastien.guay13@gmail.com on 15 Jun 2009 at 3:11