Forum Stats

  • 3,875,354 Users
  • 2,266,905 Discussions
  • 7,912,170 Comments

Discussions

Problem with programming a public move method for an object

843799
843799 Member Posts: 49,999
edited Jul 19, 2010 3:27PM in Java 3D
Hello,

I`d like to program a method that moves an object of a TransformGroup from Position (float start) to position (float end).
The signature could look like this: +moveObject(pTG:TransformGroup,pStart:float,pEnd:float)
But the problem I have is that I don`t know how to move an object independent of an user action like pressing a key.
I`v already tried e.g. the PositionInterpolator or an own Behavior-Class, but the problem is that there isn`t a
suitable WakeupCriterion.

Has anybody an idea how to solve that problem?

Thanks
loejen

Edited by: loejen on Jul 6, 2010 10:55 AM

Comments

  • 843799
    843799 Member Posts: 49,999
    I think you could use adequate Alpha parameters:
    Alpha   movAlpha    = new Alpha(1, trigTime*1000,0,Duration*1000,(Duration)*100,0);
    In this piece of code,
    trigTime
    is the number of seconds from start elapsed before start of move and
    Duration
    is how long is the move
This discussion has been closed.