Hi!
I am really really new to opengl and I prefer to do my programming in java opengl. What I am trying to do is build a skeleton with a head, torso, arms, and legs with quadrics. I googled a bit and some links said to make a joint class and a main class and start from there. Currently I am trying to read from a .skel file and create the skeleton from the given data. Here are the contents of the .skel file (which basically a text file) and here is my joint class.
.skel file:
root
Offset: [0.0, 0.0, 0.0]
Boxmin: [-0.2, -0.3, -0.15]
Boxmax: [0.2, 0.3, 0.15]
head
Offset: [0.0, 0.3, 0.0]
Boxmin: [-0.1, 0.0, -0.1]
Boxmax: [0.1, 0.2, 0.1]
hip_l
Offset: [-0.1, -0.3, 0.0]
Boxmin: [-0.05, -0.3, -0.05]
Boxmax: [0.05, 0.0, 0.05]
knee_l
Offset: [0.0, -0.3, 0.0]
Boxmin: [-0.05, -0.3, -0.05]
Boxmax: [0.05, 0.0, 0.05]
hip_r
Offset: [0.1, -0.3, 0.0]
Boxmin: [-0.05, -0.3, -0.05]
Boxmax: [0.05, 0.0, 0.05]
knee_r
Offset: [0.0, -0.3, 0.0]
Boxmin: [-0.05, -0.3, -0.05]
Boxmax: [0.05, 0.0, 0.05]
Joint class:
import com.sun.opengl.util.Animator;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.glu.GLU;
import java.io.*;
import java.util.*;
public class SkeletonJoint {
String name = " ";
float[] offset = new float[3];
float[] boxmin = new float[3];
float[] boxmax = new float[3];
float[] pose = new float[3];
public SkeletonJoint() {
}
public void setName(String Jname) {
name = Jname;
}
public String getName() {
return name;
}
public void setOffset(float x, float y, float z) {
offset[0] = x;
offset[1] = y;
offset[2] = z;
}
public float[] getOffset() {
return offset;
}
public void setBoxMin(float x, float y, float z) {
boxmin[0] = x;
boxmin[1] = y;
boxmin[2] = z;
}
public float[] getBoxmin() {
return boxmin;
}
public void setBoxMax(float x, float y, float z) {
boxmax[0] = x;
boxmax[1] = y;
boxmax[2] = z;
}
public float[] getBoxmax() {
return boxmax;
}
public void setPose(float x, float y, float z) {
pose[0] = x;
pose[1] = y;
pose[2] = z;
}
public void draw() {
// Gl gl = = drawable.getGL();
}
public float[] getPose() {
return pose;
}
}
Where do I go from here?