Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (552)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  HELP: Quaternions and tranformation/rotation matrices  (Read 792 times)
0 Members and 1 Guest are viewing this topic.
Offline ASL

Senior Newbie





« Posted 2005-08-11 20:11:30 »

Im trying to learn bone animation. My designer has chosen the 3d-format, b3d.
If you want to help me with my problem but dont know the b3d-fileformat here is the specifications http://www.zen54709.zen.co.uk/b3dformat.htm#BB3D

So far I know how to make a glCanvas show a frozen non-animated version of my designers models. Now its time that I learn the animation part.

I have been told to read alot about quaternions and transformation matrices. I have also been told to make a tranformation and rotation matrix for each NODE in the model. I have writen a chunkWriter that println's some info in each chunk to the screen - just to make me more comfortable with the way a b3d-file is build up. It looks more or less like this:

BB3D - 6184 Bytes - version: 1
    TEXS - 43 Bytes - TexturePath: .\snowdrag.png -  xpos: 0.0 ypos: 0.0 xscale: -0.0 yscale: -8.8E-44 rotation: 8.8E-44
    BRUS - 47 Bytes
    NODE - 6066 Bytes - Node name: ROOT. Position: (0.0, 0.0, -0.0). Scale: (1.0, 1.0, 1.0). Rotation: (1.0, 0.0, 0.0, -0.0).
        MESH - 4372 Bytes - Master brush: -1
            VRTS - 2332 Bytes - Flags: 0, 1, 2. 5 floats/vert.(x,y,z,u,v). All vertices writen to Vertices.txt
            TRIS - 2020 Bytes - Brush: -1 - Triangles: 168 - All triangles has been writen to Triangles.txt and Pollies.txt
        ANIM - 12 Bytes - Flag: 0 - Frames: 30 - Fps: 0.0
        NODE - 1613 Bytes - Node name: joint1. Position: (0.04537487, 0.0, -22.83983). Scale: (1.0, 1.0, 1.0). Rotation: (-4.3711385E-8, -4.3711392E-8, 1.0, 4.3711392E-8).
            BONE - 520 Bytes. Vertex1: 0 - Weight1: 1.0. Vertex2: 1 - Weight2: 1.0
            KEYS - 84 Bytes - Flag: 1 - Frame: 1 - Position: (0.0453749, -0.3333354, -0.0064964294).
            KEYS - 104 Bytes - Flag: 4 - Frame: 1 - Rotation: (-6.1817246E-8, -6.181724E-8, 0.70710695, -0.7071066).
            NODE - 826 Bytes - Node name: joint2. Position: (0.0, 0.0, -23.25). Scale: (1.0, 1.0, 1.0). Rotation: (-4.3711488E-8, -3.1391647E-7, -3.1391647E-7, -1.0).
                BONE - 408 Bytes. Vertex1: 3 - Weight1: 1.0. Vertex2: 4 - Weight2: 1.0
                KEYS - 100 Bytes - Flag: 1 - Frame: 1 - Position: (-1.9895195E-13, -1.9895198E-13, -23.25).
                KEYS - 124 Bytes - Flag: 4 - Frame: 1 - Rotation: (-4.3711488E-8, -3.1391647E-7, -3.1391647E-7, -1.0).
                NODE - 115 Bytes - Node name: joint3. Position: (0.0, 0.0, -22.75). Scale: (1.0, 1.0, 1.0). Rotation: (1.0, 0.0, 0.0, -0.0).
                    BONE - 0 Bytes.
                    KEYS - 20 Bytes - Flag: 1 - Frame: 1 - Position: (0.0, 0.0, -22.75).
                    KEYS - 24 Bytes - Flag: 4 - Frame: 1 - Rotation: (1.0, 0.0, 0.0, 0.0).

I assume that the 4 floats in Rotation in each node is the quaternoin I have to use to make the matrix, is that right?
Also, the quaternion will only give me a 3x3matrix... isnt it a 4x4matrix I have make?
This is where im standing.. this whole quaternion/transformation matrix stuff is quite a mouthfull for me!! So I hope someone can tell me what to do next. Each NODE gives also a position(3 floats) and a scale (3 floats). Where do I use them?

heres some math, whatelse do I need to do?

Matrix =  [ 1 - 2y2 - 2z2    2xy - 2wz      2xz + 2wy
                   2xy + 2wz    1 - 2x2 - 2z2    2yz - 2wx
                   2xz - 2wy      2yz + 2wx    1 - 2x2 - 2y2 ]
given the quaternion Q (w, x, y, z)
Offline g666

Junior Member





« Reply #1 - Posted 2005-08-16 19:17:25 »

Shouldnt this be in a different section Shocked...

desperately seeking sanity
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (23 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (41 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!