Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (579)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / OpenGL Development / Re: My texture shows as one colour when I use CLAMP_TO_EDGE?? on: 2006-06-21 18:12:48
I fixed the problem. When TexCoords are out of range 0-1 everything gets the same color as the border, when using CLAMP_TO_EDGE. I had my Coords negated by mistake. It worked, but not with CLAMP!
2  Java Game APIs & Engines / OpenGL Development / My texture shows as one colour when I use CLAMP_TO_EDGE?? on: 2006-06-21 15:05:56
Here is what I do:

GL11.glBindTexture(GL11.GL_TEXTURE_2D, ID);               
makeTexture(readImage(path), GL11.GL_TEXTURE_2D, true, hasAlpha);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_NEAREST);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);

After I added the last 2 lines with CLAMP_TO_EDGE my texture shows as one color like if I was using glColor. I have checked for glErrors but didnt find any. Im using mipmaped pngs as textures. If I remove the two lines everything works perfect again. Except for the seams between the textures I want to minimize using CLAMP_TO_EDGE.

GL12 is supported on my comp, but I should mention that its a laptop with a graphicscard that dont support shaders for instance. I have an exe-file from a tutorial on how to make a skybox and such that uses CLAMP_TO_EDGE and that file works perfect when executed. so CLAMP should work. So Im quite puzzled about why this happens.

Is it my graphicscard?
Is it LWJGL?
Or maybe something else..

Im desparate!
Thanks in advance.
3  Java Game APIs & Engines / OpenGL Development / Re: How do I test for key typed or released with the Keyboard class? on: 2006-04-20 13:18:52
Yes it worked, thanks!  Wink
4  Java Game APIs & Engines / OpenGL Development / How do I test for key typed or released with the Keyboard class? on: 2006-04-20 12:17:28
The Keyboard class only has Keyboard.keyPressed. How do I test for released or typed. I dont think you can add a listener to the Display's drawable, but even if you can it would be great if I could stick with Keyboard-class. Its nice and easy to use!
5  Java Game APIs & Engines / JOGL Development / Problems with my first person/free mouse view. on: 2006-04-08 12:16:22
Hi all!
Im working on a JOGL-engine. Skeletal animation, tweening, texturemapping has been implemented so far and Im working to get free mouse view to run smoothly. Right now thats far from the case. Im using the KeyListener interface and when I hold down a key I move an inch and then I get a delay of 500-1000 ms and then I move some more. So in not getting smooth movement when I hold down a key.
Someone told me to use a keybuffer that I should update every keyup/down and then use in my display-loop. What ever he meant im not sure, cus its the KeyEvent that seems to fire off with a delay. If I should not use the KeyEvent class then how would I know when a key is pressed?
6  Game Development / Game Mechanics / Re: Need help with quarternions -> transformation Matrix on: 2005-08-23 18:55:48
No I have not aswered my own problem. I have already extracted the 4 floats of the quaternions and interchanged them in order to get rotation work. I create Quat4f instances right, so much I know. So its not the Quat thats giving problems - well it could be if a given rotation is create with a different Quaternion in Blitz3D than in java...

Quote
Or: when you transform a bone you change the vertices of that bone. This has nothing to do with local coordinate system. You simply transform your vertices by the same transform, with which you transform also the bone.
But dont that also potentially mean that all vertices of all bones during animation has to go through a transform? Isnt that what you call "mesh animation"? I have read that the whole idea of bone animation is that you dont have to transform each and every vertex. And I see how that is posible if you just run the vertices as they are in the mesh and after just rotating the coordinate system appropriately for each frame.
7  Java Game APIs & Engines / JOGL Development / How do I transform the modelview matrix with a Java matrix? on: 2005-08-23 17:46:29
How do I transform the modelview matrix in OpenGL in with a Java matrix using JOGL?

Im trying to master the art of bone animaiton and Im using the javax. vecmath package. It contains the Matrix4f-class.
So when I have the right transformation matrix in the form of a Matrix4f instance, how do I pass it into OpenGL through JOGL?
8  Game Development / Game Mechanics / Re: Need help with quarternions -> transformation Matrix on: 2005-08-22 22:24:17
That was a good question... I tried a simple translation 5 units down the z-azis. It does not work inverted.. Well it does but then it changes the position -5 down the z-azis instead.
This is truely wierd. So to get rotation right I have to invert but then translation doesnt work - and the other way around when I dont invert... Its beginning to sound like a notational problem.

To begin with I couldnt get anything to work... then I found out that the file lists a quaternion w,x,y,z while the java-class Quat4f reads in a quaternion x,y,z,w.. so I changed the entries around and then it worked!

I cant figure out what is the problem - you got some ideas?

-----

Well I could bypass the problem by doing this:


Psedocode
1  
2  
3  
Matrix.set(rotation);
Matrix.invert();
Matrix.set(translation);


But then again... That would be assuming that the problem lies in the Matrix4f-class!  Undecided

The designer works in MilkShape - he then exports the work to a Blitz3d file (b3d). I know that coordinatesystems can differ - for example have I found out that I have to change the sign of the z values my designer read off MilkShape when giving me the resulting vertex info. I have also heard that matrices can differ as well. The entries in the top row in a Matrix in java lies in the first colomn in OpenGL for example - at least so Ive heard. Maybe its in this we can find our problem. when exporting as b3d he is building a format that works in Blitz3d programs. Maybe the matrix is different in Blitz an hence the quaternion. Just guessing...

--------------

Heres a whole different question that has poped resently. Until now I have had the idea that in bone animation you have to run the entire pool of vertices through differnt matrices every frame. My designer just told me that this is wrong. He say that the idea in bone animation is that you run all the vertices affected by a given bone in one run. To begin with I couldnt understand how that could be posible, but now I see it must be posible if you change the local coordinatesystem in OpenGL according to a transformation matrix and just run the vertices as they are given in the file. If this is so, then I have had a whole twisted look upon bone/skeletal animaiton. Please comment on this to.... Embarrassed
9  Game Development / Game Mechanics / Re: Need help with quarternions -> transformation Matrix on: 2005-08-22 19:33:27
Well, to be honest I started out with an even more simple case; 1 joint with 1 triangle centered on it. Animation consisted of rotation around the center only. Again my designer gave me the positions of triangles vertices on each keyframe. Even this simple example toke me some time to figure out. It was a lucky shot - I tried to invert the matrix as a last try - and the resulting positions were exactly the same as the positions I got from my designer. Cheesy

Here are the calculations from that setup:

The mesh - extracted from the 3dfile:
v1: (0.0, 36.0, 4.142857)
v2: (0.0, 15.999998, 4.142857)
v3: (0.0, 25.999994, 24.142862)

The vertex info of each keyframe - from my designer:

(aproximations)
KF 1 (frame1):
v 1: y26,z24,x0
v 2: y36,z4,x0
v 3: y16,z4,x0

KF 2 (frame5):
v 1: y-6,z35,x0
v 2: y16,z32,x0
v 3: y5,z16,x0

My calculations that gave the right result:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
                 Quat4f q1 = new Quat4f(0.0f, 0.0f, 0.0f, 1.0f);
         Vector3f v1 = new Vector3f(0.0f, 0.0f, 0.0f);
         Matrix4f m1 = new Matrix4f(q1, v1, 1.0f);
         m1.invert();

                Quat4f q5 = new Quat4f(-0.47715867f, 0.0f, 0.0f, 0.87881714f);
         Vector3f v5 = new Vector3f(0.0f, 0.0f, 0.0f);
         Matrix4f m5 = new Matrix4f(q5, v5, 1.0f);
         m5.invert();

                 //transforming a vertex from frame 1.
        Point3f pStart1 = new Point3f(0.0f, 15.999998f, 4.142857f);
         Point3f pEnd1 = new Point3f();     
        
         m1.transform(pStart1, pEnd1);
         System.out.println(pEnd1);
        
         //transforming a vertex from frame 5.
        Point3f pStart5 = new Point3f(0.0f, 15.999998f, 4.142857f);
         Point3f pEnd5 = new Point3f();     
        
         m5.transform(pStart5, pEnd5);
         System.out.println(pEnd5);


Console result:
(0.0, 15.999998, 4.142857)
(0.0, 5.2397346, 15.675087)

The calculations of frame1 are obvious. Its an identitymatrix which is the reason why the vertices from the mesh equals the values I got from my designer even before transformation (take a look). The calculations of frame 5 is less obvious. Before I got the idea of inverting the matrix nothing worked. After I inverted everything fell into place. I got the idea of inverting from one of your earlier replies in this thread Wink
10  Game Development / Game Mechanics / Re: Need help with quarternions -> transformation Matrix on: 2005-08-22 17:43:38
I have had my designer setup ultra-simple test-cases for me, which is great! Smiley

He send me a file with the simplest imaginalbe situation with some animation in it. The test-case consists of only 3 joints. Its like an arm - starting at joint1 (shoulder) no animation here so only 1 keyframe - joint2 (albow) has some animation and hence 2 keyframes. - the last is joint3 (the wrist) has no animation. The total mesh is one single triangle placed on joint3.

From the file I have extracted the mesh (3 vertices):
(0.0, 22.909605, 17.545069)
(0.0, 4.600046, 20.834839)
(0.0, 15.823223, 36.61981)


Also I have asked my designer to read the the position of each vertex at each keyframe - x =0:

KF 1 (frame1)

v 1: y30, z21
v 2: y26, z1
v 3: y12, z13

KF2 (frame10)

v 1: y20.5, z-26.75
v 2: y0.25, z-28
v 3: y8.5, z-11.75



As I see it this is good, because I have the starting position and the resulting positions. Now all I need to get right is the calculations that transform the vertices in the mesh.
To start with I want to calculate the positions of the vertices in frame 1.

Here is what I did:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
 
                 Quat4f qFrame1_joint1 = new Quat4f(0.0f, 0.9567119f, -0.29103667f, 0.0f);
         Vector3f vFrame1_joint1 = new Vector3f(0.0f, -20.0f, -18.75f);
         Matrix4f mFrame1_joint1 = new Matrix4f(qFrame1_joint1, vFrame1_joint1, 1.0f);
         mFrame1_joint1.invert();        
        
         Quat4f qFrame1_joint2 = new Quat4f(0.0f, 0.3604212f, -0.9327897f, 0.0f);
         Vector3f vFrame1_joint2 = new Vector3f(0.0f, 0.0f, -26.487024f);
         Matrix4f mFrame1_joint2 = new Matrix4f(qFrame1_joint2, vFrame1_joint2, 1.0f);
         mFrame1_joint2.invert();
        
         Quat4f qFrame1_joint3 = new Quat4f(0.0f, -0.9244745f, -0.3812439f, 0.0f);
         Vector3f vFrame1_joint3 = new Vector3f(0.0f, 0.0f, -26.487024f);
         Matrix4f mFrame1_joint3 = new Matrix4f(qFrame1_joint3, vFrame1_joint3, 1.0f);
         mFrame1_joint3.invert();
        
         mFrame1_joint1.mul(mFrame1_joint2);
         mFrame1_joint1.mul(mFrame1_joint3);
        
         Point3f pStart = new Point3f(0.0f, 22.909605f, 17.545069f);
         Point3f pEnd = new Point3f();     
        
         mFrame1_joint1.transform(pStart, pEnd);
         System.out.println(pEnd);



It does not seem to give me the right result. What am I doing wrong here. I know the Quaternions and Matrices are build right.
If I could get some help on this one it would be great! Undecided
11  Game Development / Game Mechanics / Re: Need help with quarternions -> transformation Matrix on: 2005-08-13 00:31:23
Wow.. there was alot of new good stuff!

Quote
Important: Your vertices should not be children of Bones
I didnt think that was even posible. I only thought nodes could be children or parents. I think thats the case in b3d anyway!

Quote
Let V be a vertex and m1, m2, m3 be the matrices of the transforms you applied to the Bones and k1, k2, k3 the weights of the Bones. Then your transformed Vertex V' = m1.mul(V).scale(k1)+m2.mul(V).scale(k2)+m3.mul(V).scale(k3);

Note: m1, m2, m3 are not the transform of the bones, but the transformation you apply to the Bones, e.g. when modifing them.
I think I have to look at that some 100 times, before I really grasp whats goin on! Wink But im confident that I will understand it some day soon!
3 matrices - where do they come from? I thought there was only one...
3 weights of the bones. I dont fully understand. The file-output tells me that there are 1 weight for each vertex in the BONE chunk. Can you explain to me in more details?

1  
2  
3  
4  
5  
6  
7  
Matrix4f newTrans: the Matrix of the new Frame
Matrix4f oldTrans: the Matrix of the old Frame
Matrix4f trans: the Matrix to be aplied to the vertices:
trans.set(oldTrans);
trans.invert();
trans.mul(newTrans,trans);
// => oldTrans*trans = newTrans :)

Wow, that I fully understand. I have the former frames Matrix and I mul it with the next keyframes Matrix to get the new Matrix. In the next frame again I make oldMatrix = newMatrix and do it all over again.
So when I calculate vertices for oldFrame and do the same for nextFrame, isnt this where I apply the weight to get fluent motion between the keyframes?

Well this again is really a giant step foreward for me... Thz alot!
In case of more questions on this subject:
Is it too much to ask, if you are on msn? If you are too busy for that, I fully understand...
12  Game Development / Game Mechanics / Re: Need help with quarternions -> transformation Matrix on: 2005-08-12 22:54:25
Thanks again Arne, this is really helping me alot!

Concerning Question 2, I guess I just have to find out why 3 scale-floats are given for each NODE. In any case as you see in the file output the scale floats seem to be 1.0 most of the times.

In Your answer to my 3. question you say that I use the matrix to transform a position. By position, do you mean the vertices that a given bone affects? Then where do I use the weight of those vertices...

In my 4th. question I talk about 2 KEYS for each NODE. Im refering to the b3d-output in my initial post... I wrote a b3dChunkWriter that lists what chunks are inside a given b3d-file + it gives an illustration of the herachi of the chunks. It also lists some info about whats inside of each chunk. If you look at the output you will see that each NODE (not included the ROOT-NODE) in this particular file contains a BONE chunk, 2 KEYS chunks and maybe a child NODE chunk.
I have only told the writer to print the info about the first keyframe i KEYS-chunks. Take a look!
The first KEYS-chunk gives the position of each keyframe. The second KEYS-chunk gives the rotation of each keyframe.
Well, thats what it says, cus I dont wanna sound like I know haw to use this info. I dont!

Maybe you know about a page where I can read about this particular subject.
13  Java Game APIs & Engines / JOGL Development / Re: Quaternions and transformation-Matrices -- Plz help me! on: 2005-08-12 12:31:07
Some helpfull guy helped me with the matrix..
Here's what Arne wrote:

"Use javax.vecmath !!! Then it gets really simple:


Code:
Matrix4f m = new Matrix4f();
m.set(<the quaternion>); //set the rotation
m.set(<the vector>); //set the position

I don't know how you can set scaling, but there's probably also a method for that."
--------

And I must admit.. The vecmath package is very usefull!

I have a few more questions:

1. Is this matrix the only one I have to make for each node? Do I need one for each axis?

2. The Matrix4f constructor looks like this: Matrix4f(Quat4f q1, Vector3f t1, float s) .
So the constructor makes use of the 4 floats in rotation, the 3 floats in position, but only 1 float from scale. Which one? This is why I ask if I have to make a matrix for each axis...

3. And this question is a little embarasing: now that I have the matrix how exactly do I use it? I know it has to do with cross products and likely the vertices and their weights for each bone. Where do I read about this? If someone could throw me a link to a good page it would be great..

4. I see I have 2 KEYS for each NODE. One for rotation and one for position of each keyframe. How do I use them?

Thanks in advance - and a great weekend to y'all!
14  Game Development / Game Mechanics / Re: Need help with quarternions -> transformation Matrix on: 2005-08-12 12:16:27
Thz alot, Arne!
That was really helpfull.. and suprisingly easy Smiley
I found that the javax.vecmath package comes from the java3D API. So far so good..
I have a few more questions:

1. Is this matrix the only one I have to make for each node? Do I need one for each axis?

2. The Matrix4f constructor looks like this: Matrix4f(Quat4f q1, Vector3f t1, float s) .
So the constructor makes use of the 4 floats in rotation, the 3 floats in position, but only 1 float from scale. Which one? This is why I ask if I have to make a matrix for each axis...

3. And this question is a little embarasing: now that I have the matrix how exactly do I use it? I know it has to do with cross products and likely the vertices and their weights for each bone. Where do I read about this? If someone could throw me a link to a good page it would be great..

4. I see I have 2 KEYS for each NODE. One for rotation and one for position of each keyframe. How do I use them?

Thanks in advance - and a great weekend to y'all!
15  Discussions / Community & Volunteer Projects / Re: Begining Java programmer looking for... on: 2005-08-11 22:26:59
Your mail adress is hidden... just so you know!
16  Game Development / Game Mechanics / Need help with quarternions -> transformation Matrix on: 2005-08-11 22:15:34
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)
17  Java Game APIs & Engines / JOGL Development / Quaternions and transformation-Matrices -- Plz help me! on: 2005-08-11 22:13:33
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)
18  Game Development / Newbie & Debugging Questions / HELP: Quaternions and tranformation/rotation matrices on: 2005-08-11 22: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)
19  Java Game APIs & Engines / JOGL Development / B3D loader written in java on: 2005-07-21 12:58:42
Hi all!
I have been studying jogl and OpenGL in general for some time now. The next step for me is to load a 3d model into a stucture and make my display() read from it.
My designer and I have chosen to use the blitz format, so what im looking for is a b3d loader written in java!
Do any of you know the location of such a loader on the net, or do I have to write it myself.
20  Java Game APIs & Engines / JOGL Development / Re: JOGL 1.1 released on: 2005-07-03 15:13:23
I have been looking forward for this release. Really nice!!

But JOGL will become part jre some day, right? soon? I mean that must be what this whole project is aiming for..
21  Java Game APIs & Engines / JOGL Development / Re: Beginner having trouble loading textures - plz help! on: 2005-07-03 14:54:20
I found the problem... for what ever reason I have to specify Parameters for both textures...

      texture1 = genTexture(gl);
      texture2 = genTexture(gl);     
     
      gl.glBindTexture(GL.GL_TEXTURE_2D, texture1);
      gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_LINEAR);
      gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_LINEAR);
      BufferedImage img1 = readPNGImage("data/ja.JPG");
      makeRGBTexture(gl, gLDrawable.getGLU(), img1, GL.GL_TEXTURE_2D, false);
     
     
      gl.glBindTexture(GL.GL_TEXTURE_2D, texture2);
      gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MIN_FILTER,GL.GL_LINEAR);
      gl.glTexParameteri(GL.GL_TEXTURE_2D,GL.GL_TEXTURE_MAG_FILTER,GL.GL_LINEAR);
      BufferedImage img2 = readPNGImage("data/NeHe.png");
      makeRGBTexture(gl, gLDrawable.getGLU(), img2, GL.GL_TEXTURE_2D, false);

Funny that default parameters dont exist!? Maybe one of you guys can explain to me the logic...
22  Java Game APIs & Engines / JOGL Development / Beginner having trouble loading textures - plz help! on: 2005-07-03 12:47:05
Im a beginner, so plz bare with me!
I have been strugling to learn jogl for the last few days and Im learning from the NeHe tutorials.
I enjoy them alot but I have a problem: I cant seem to figure out how to load more than 1 texture at once.
What is wrong here:

      texture1 = genTexture(gl);
      texture2 = genTexture(gl);
     
      gl.glBindTexture(GL.GL_TEXTURE_2D, texture1);     
      BufferedImage img1 = readPNGImage("data/ja.JPG");
      makeRGBTexture(gl, gLDrawable.getGLU(), img1, GL.GL_TEXTURE_2D, false);
     
     
      gl.glBindTexture(GL.GL_TEXTURE_2D, texture2);     
      BufferedImage img2 = readPNGImage("data/NeHe.png");
      makeRGBTexture(gl, gLDrawable.getGLU(), img2, GL.GL_TEXTURE_2D, false);

I realize that the problem must be related to my attempt to try to bind different textures (names) to GL.GL_TEXTURE_2D. Or is it?
23  Java Game APIs & Engines / JOGL Development / Re: How to: Getting started with JOGL on: 2005-06-14 00:24:57
Gregory wrote: "At this point you might want to take a look at some OpenGL resources as it won't matter whether or not you're coding in C++ or Java as OpenGL is OpenGL and it will be simple to tell what needs to be syntactically changed to work with JOGL (or LWJGL for that matter)."

I have been looking around but its a jungle... Could some one please guide as to where I should begin? I have done the tutorial on http://www.genedavissoftware.com/books/jogl/index.html and I understand it all... I just dont know where to go from here

I have no 3D experience - but its 3D I want to learn! basics first.....  Where do I begin???
24  Java Game APIs & Engines / JOGL Development / Re: Please help this newbie... on: 2005-06-03 13:40:19
Can I even compile JOGL programs with my grafics card: RADEON IGP 320M
25  Java Game APIs & Engines / JOGL Development / Please help this newbie... on: 2005-06-03 11:45:05
Im a little confused... I have alot of java installed on my pc and I dont know exactly how it works.
Im using XP home edition and eclipse and I have the following java installed:

J2SE Development Kit 5.0 Update 3 - 278MB
J2SE Runtime Environment 5.0 Update 2 - 117MB
J2SE Runtime Environment 5.0 Update 3 - 301MB
Jave 2 Runtime Environment, SE v1.4.2 - 61.63MB
Jave 2 Runtime Environment, SE v1.4.2_05 - 135MB
Java 3D 1.3.1 (OpenGL) SDK - 1.09MB

When I have so many directories of java Im confused as to which of them I should install JOGL and how.
Do I even have the right JDK installed?
My objective is to start learning JOGL and make my eclipse understand it.

Could someone guide me step be step all the way down to the button click!
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (38 views)
2014-04-15 18:08:23

BurntPizza (34 views)
2014-04-15 03:46:01

UprightPath (50 views)
2014-04-14 17:39:50

UprightPath (32 views)
2014-04-14 17:35:47

Porlus (49 views)
2014-04-14 15:48:38

tom_mai78101 (71 views)
2014-04-10 04:04:31

BurntPizza (130 views)
2014-04-08 23:06:04

tom_mai78101 (230 views)
2014-04-05 13:34:39

trollwarrior1 (193 views)
2014-04-04 12:06:45

CJLetsGame (200 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!