Hello Guest

Quaternions?

  • 20 Replies
  • 17160 Views
*

Offline fbi

  • **
  • 56
Quaternions?
« on: June 16, 2004, 15:54:41 »
Hello everybody,
since I'm currently in the process of dealing with some quaternion stuff for my engine, I was wondering if anybody out there is interested into the same stuff.
If this is case, do you think would it be the case to include that into the next LWJGL release?  :)

hmmmmmm
« Reply #1 on: June 16, 2004, 19:47:40 »
Call me stupid :roll: , but what are quaternions? :)
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

Quaternions?
« Reply #2 on: June 16, 2004, 21:14:37 »
Quaternions are a way to represent a rotational transform without using a matrix.  I for one would like to have a nice Quaternion implementation to use in lwjgl.
I can no longer sit back and allow, communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy, to sap and impurify all of our precious bodily fluids." - Gen. Jack T. Ripper

*

Offline fbi

  • **
  • 56
Pre-release
« Reply #3 on: June 17, 2004, 10:17:52 »
Hi people,
you can take a look at the current version of the code at
Some notes:

1) I used the method negate to implement the conjugate operator, in order to be LWJGL-compliant  :D
2) I didn't implement a straight Euler-to-Quaternion conversion as it can be done via the axis-angle
3) I tried to be as tight as possible to the existent LWJGL API, keeping an eye to the javax.vecmath Quaternion implementation shipped with Java3D

Any comment is absolutely welcome  :wink:

*

Offline fbi

  • **
  • 56
Quaternions?
« Reply #4 on: June 17, 2004, 10:22:43 »
Oh sorry...damn hard programming...I forgot the URL!  :lol:
Here it is:  http://ant1.di.uniba.it/lwjgl/Quaternion.java

*

Offline fbi

  • **
  • 56
SLERP
« Reply #5 on: June 17, 2004, 10:24:36 »
Ok...I forgot to say that I'm going to implement SLERP, too  :)

Quaternions?
« Reply #6 on: June 17, 2004, 12:53:50 »
Quaternions should not be in core LWJGL, IMO. That's the sort of thing that should be packaged up in a separate jar. IIRC Cas was talking about doing that with the Vector stuff some time ago.

Quaternions?
« Reply #7 on: June 17, 2004, 13:01:57 »
I'm using the seperate vecmath.jar from Java3D (it has nothing to do with Java3D though), which contains the javax.vecmath package, for all vector math. It also contains quaternion classes, you might want to take a look!

You can get vecmath-1.3.1.jar here:
http://www.twinklestone.de/stuff/vecmath-1.3.1.jar

*

Offline fbi

  • **
  • 56
2 answers in one
« Reply #8 on: June 17, 2004, 13:15:40 »
Yeah...I took a look at it and some functions are adapted from that code even if they use a lot of redundant types (in my opinion, of course)  :)
Anyway I didn't think to include this as a part of the core...all in all a utils.jar seems to be a viable option.

*

Offline princec

  • *****
  • 1933
    • Puppygames
Quaternions?
« Reply #9 on: June 17, 2004, 13:31:24 »
All the vector stuff has now been moved to org.lwjgl.util.vector, which will be available as a separate jar of odds and sods.

Cas :)

*

Offline fbi

  • **
  • 56
Quaternions?
« Reply #10 on: June 17, 2004, 13:48:28 »
I know it very well...I'm using such a version indeed  :wink:
I was thinking that if quaternions stuff could be of any use, should be packed there  :)

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Quaternions?
« Reply #11 on: June 17, 2004, 14:26:23 »
Sorry for the late reply (inet connection problems).

I'm more than interested in quats and I have an implementation in our project (heavily used in skeletal animation). A complete implementation would be great in the LWJGL vector package. Although I'm not using it (I had most of it implemented before it showed up), I might do sometime.

One note about all math packages: If you create an object behind my back I'm not going to use you! I'm not really familiar with the lwjgl vector package, but that is the main reason I don't use Java3D's (and preferred to do it myself). So the request I have is (for you and anyone responsible for the math package) to provide as many methods necessary to avoid having to create loads of new objects.

By the way, I can't download your code.

*

Offline fbi

  • **
  • 56
Quaternions?
« Reply #12 on: June 17, 2004, 14:44:39 »
Ok...Spasi...try to take a look at the actual code now (we experimented some connection problems in our department today)  :x
Tell me if the methods I created are enough for your format needs  :wink:

*

Offline princec

  • *****
  • 1933
    • Puppygames
Quaternions?
« Reply #13 on: June 17, 2004, 16:21:03 »
All the LWJGL vecmath code is designed so no objects are created. We'd like a compatible quaternion class.

Cas :)

*

Offline fbi

  • **
  • 56
Quaternions?
« Reply #14 on: June 17, 2004, 18:26:36 »
As you might notice this is guaranteed by the fact that Quaternion inherits from Vector4f and the fact that I took a look in depth at your code  :wink: