Featured games (90)
games approved by the League of Dukes
Games in Showcase (556)
games submitted by our members
Games in WIP (476)
games currently in development
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Camera interpolation  (Read 671 times)
0 Members and 1 Guest are viewing this topic.
Offline frdfsnlght

Senior Newbie

Trying to understand

« Posted 2004-05-28 23:32:38 »

This is a general 3D question, not specific to Java3D, altough that's what I'm using.

I'm trying to move my camera between two points in 3-space. There's also a change in orientation involved. Interpolating the position is a no brainer. I found that by using quaternions to represent the orientation, I can interpolate using "great circle interpolation" (I think this is also called SLERP?). It mostly works, but the interpolation seems to break down when interpolating between certain orientations. By breakdown, I mean the current camera orientation converges toward the target orientation, but never quite makes it, and ends up bouncing around some other intermediate orientation, never getting to the target orientation.

Is this a common problem with quaternions? Am I doing something wrong? Is there a better way to accomplish this?

Here's a chunk of code I'm using, which gets executed on each frame (*Rotation is a Quat4f, *Location is a Vector3f):

public void stepFrame() {
    targetTransform.get(targetRotation, targetLocation);
    currentTransform.get(currentRotation, currentLocation);

    targetLocation.interpolate(currentLocation, 0.8f);
    targetRotation.interpolate(currentRotation, 0.8f);
    targetTransform.set(targetRotation, targetLocation, 1);



Pages: [1]
  ignore  |  Print  


Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

digdugdiggy (12 views)
2014-03-14 23:54:44

Rayvolution (22 views)
2014-03-13 00:02:00

The Lion King (45 views)
2014-03-11 04:35:53

Screem (67 views)
2014-03-08 05:04:17

Screem (69 views)
2014-03-08 05:01:59

Gibbo3771 (79 views)
2014-03-05 15:13:19

Conzar (80 views)
2014-03-05 09:59:23

Conzar (77 views)
2014-03-05 09:57:20

GamerIDGoesHere (109 views)
2014-03-02 10:31:15

GamerIDGoesHere (96 views)
2014-03-02 10:30:27
Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-10 14:19:36

HotSpot Options
by Roquen
2014-02-26 17:00:23

HotSpot Options
by Roquen
2014-02-26 11:27:03

HotSpot Options
by Dxu1994
2014-02-18 01:05:35

HotSpot Options
by SwordsMiner
2014-02-16 03:47:31

by Roquen