Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - han1332

#1
Support / Re: animation example
August 13, 2007, 10:52:37 PM
thanks for answering
it is quite clear now, but i still have troubles with animation.
i try to get it work with a box,but there is something wrong
is it basically correct?


private void init3DStuff()
{
....
  obj = new Object3D(Primitives.getBox(10, 1));
....
  anim = new Animation(2);
....
  anim.setInterpolationMethod(Animation.LINEAR);
  anim.addKeyFrame(obj.cloneObject().getMesh());
  obj.translate(10, 10, 0); 
  anim.addKeyFrame(obj.cloneObject().getMesh());
  obj.setAnimationSequence(anim);
  obj.build();
  world.addObject(obj);
}

private void gameLoop() {
......
while (!exit) {

....
if(anim_count <=1)
{
anim_count += 0.1f;
obj.animate(anim_count, 0);
}
else {
count = 0;
obj.animate(anim_count, 1);
}
....
.....
                try {
Thread.sleep(200);
} catch (InterruptedException e) {
}
}

System.exit(0);
}




thanks
hannes
#2
Support / Re: animation example
August 13, 2007, 04:26:48 PM
i know,
maybe it is a not a good example, but i only want to know how animation with keyframes works.
i want to use it for product animation, something should move in a certain
behavier(using certain interpolation methods) from one place to another.
i hope it is clear what i mean.

mfg hannes
#3
Support / animation example
August 13, 2007, 03:25:21 PM
hi!

I am a jpct beginner.
Can anybody send me simple examples using animation with keyframes.
For example moving a box from one position to another.

thank you
Hannes