[osg-users] Animating vertices in a Geode

Laurence Muller L.Y.L.Muller at uva.nl
Mon Mar 23 06:14:37 PDT 2009


Hi Cedric,

I tried to create a simple project based on the 'osganimationmorph' demo 
as Robert Osfield suggested.

Instead of loading the geometries from a *.osg file, I define two new 
geometries (both quads but on a different position). These geometries 
are added as a drawable to the MorphGeometry.
However, for some reason OSG doesn't allows me to swap the old geom0 and 
geom1 geometry objects with the ones I create. The application crashes 
when you try to run it.

Any suggestions?

Kind regards,
- Laurence


Cedric Pinson wrote:
> <div class="moz-text-flowed" style="font-family: -moz-fixed">Hi Laurence,
>
> You can easily do it with morphgeometry:
> - define two geometry with morphgeometry
> - use an custom update callback that use an ease motion to control the 
> ratio of geometry to use
>
> Would be great to make an example with it, it will help others users.
>
> Cheers,
> Cedric
>
> Laurence Muller wrote:
>> Hi,
>>
>> In the application I am working on, I am trying to create a smooth 
>> (transition) animation on the vertices inside an object.
>>
>> Example:
>> I have included an illustration to make my problem a bit more clear. 
>> The current scene contains one geode with a geometry attached.
>> The geometry is filled with 7 quads (4 vertices per quad) and is 
>> illustrated as red dots in the picture. (The 'edges' are stored in a 
>> separate geode)
>>
>> The application allows users to select a specific layout (radial, 
>> force based, etc) for the quads. In the current implementation this 
>> change happens immediately.
>> (It updates the vertex array with new values and uses the dirty() 
>> call on the vertex array).
>>
>> On the OSG wiki page I found some information about animating objects 
>> in the scene graph.
>> http://www.openscenegraph.org/projects/osg/wiki/Community/NodeKits/osgAnimation 
>>
>> http://www.robertpenner.com/easing/easing_demo.html
>>
>> However, it seems like this will only work on geode level (by 
>> modifying the Matrix or PositionAttitudeTransformation).
>> Another problem with this method is that it seems that you need to 
>> create a predefined animation.
>>
>> In my case the new position of a vertex will depend on the current 
>> position (and the animation only needs to be used once).
>>
>> Question:
>> - Is there a way to use the osgAnimation functions on the vertex 
>> array and is it possible to use it with the transition methods from 
>> the EaseMotion demo?
>>
>> Kind regards,
>> - Laurence
>>
>> ------------------------------------------
>> Laurence Muller
>> Website/Blog/Portfolio:
>> http://www.multigesture.net/
>>
>>
>> ------------------------------------------------------------------------
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
>>
>>   
>


-- 
------------------------------------------
Laurence Muller (M.Sc.)
Informatics Institute, Faculty of Science, 
Universiteit van Amsterdam.
Science Park 107, 1098 XG Amsterdam, The Netherlands

Website/Blog/Portfolio:
1. http://www.multigesture.net/
2. http://www.science.uva.nl/~lmuller/

E-mail: L.Y.L.Muller at uva.nl

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: main.cpp
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090323/85e21c6f/attachment-0003.txt>


More information about the osg-users mailing list