Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Simdanfeg

Pages: 1 2 [3]
31
Support / a question about collision detection
« on: May 18, 2011, 11:09:14 am »
 ;D
I would like to ask the realization principle of collision detection,  I saw examples of that on the collision detection, but still very unclear, such as the following code, cube is how to detect a collision with those objects, and collision detection is how to achieve, ???

Code: [Select]
// Move method
public void move() {
if (up) {
SimpleVector t = cube.getZAxis();
t.scalarMul(SPEED);
moveRes.add(t);
}
if (down) {
SimpleVector t = cube.getZAxis();
t.scalarMul(-SPEED);
moveRes.add(t);
}
if (left) {
cube.rotateY((float) Math.toRadians(-1));
}
if (right) {
cube.rotateY((float) Math.toRadians(1));
}
// Avoid high speed
if (moveRes.length() > SPEED) {
moveRes.makeEqualLength(new SimpleVector(0, 0, MAXSPEED));
}
cube.translate(0, -0.02f, 0);

// collisionEllipsoid
cube.checkForCollisionEllipsoid(moveRes, ellipsoid, 8);
cube.translate(moveRes);

SimpleVector t = new SimpleVector(0, 1, 0);
t = cube.checkForCollisionEllipsoid(t, ellipsoid, 1);
cube.translate(t);

// damping
if (moveRes.length() > DAMPING) {
moveRes.makeEqualLength(new SimpleVector(0, 0, DAMPING));
} else {
moveRes = new SimpleVector(0, 0, 0);
}
}

32
Support / Re: A question about keyFrame animation
« on: April 14, 2011, 07:06:41 am »
EgonOlsen,Very, very grateful to you, it is moving up, how exciting, ;D

33
Support / Re: A question about keyFrame animation
« on: April 13, 2011, 06:27:32 pm »
Can be displayed with JPCT, why not display it in the android, which is perplexing problem. ???

34
Support / Re: A question about keyFrame animation
« on: April 13, 2011, 04:08:51 pm »
'an'  is a variable I declaration, its value is 2,I wrote my program According to The following page http://www.jpct.net/wiki/index.php/Loading_3ds_Keyframes_from_Blender

35
Support / A question about keyFrame animation
« on: April 13, 2011, 05:17:34 am »
Thank you for your help, now I have a new question to ask your advice. I had five balls of different sizes with 3dMax, when I use the frame of animation only shows the first frame, I do not know why, I also searched the forum-related information, but still failed to resolve, the following I Show me the code to stick in here, I hope you can help me.

Code: [Select]
thing = loadModel("s0.3DS", scale);
Animation anim = new Animation(5);

anim.createSubSequence("default");
anim.addKeyFrame(thing.getMesh());

anim.createSubSequence("change");
anim.addKeyFrame(loadModel("s2.3DS", scale).getMesh());
anim.addKeyFrame(loadModel("s3.3DS", scale).getMesh());
anim.addKeyFrame(loadModel("s4.3DS", scale).getMesh());
anim.addKeyFrame(loadModel("s1.3DS", scale).getMesh());
thing.setAnimationSequence(anim);

thing.build();
world.addObject(thing);


Code: [Select]
private Object3D loadModel(String fileName, float scale) {
Loader.setVertexOptimization(false);
Object3D[] model = Loader.load3DS(LoadFile.loadf(fileName), scale);
Object3D o3d = new Object3D(0);
Object3D temp = null;

for (int i = 0; i < model.length; i++) {
temp = model[i];
temp.setCenter(SimpleVector.ORIGIN);
temp.rotateX((float) (Math.PI / 2));
temp.rotateMesh();
temp.setRotationMatrix(new Matrix());
o3d = Object3D.mergeObjects(o3d, temp);
o3d.build();
}
return o3d;
}

Code: [Select]
public void doAnim() {
{
ind += 0.02f;
if (ind > 1f) {
ind -= 1f;
}
}
thing.animate(ind, an);
}

36
Support / Re: The question on the coordinate system (Loading 3ds)
« on: April 12, 2011, 04:47:23 am »
Uh, you make me confused, I just successfully imported a teapot, but before I do the robot with 3dmax does not show up,i'll try it with you method,thank you :D

37
Support / Re: The question on the coordinate system (Loading 3ds)
« on: April 11, 2011, 04:55:01 pm »
well,i guess i found it,maybe the file is too large

38
Support / Re: The question on the coordinate system (Loading 3ds)
« on: April 11, 2011, 04:24:35 pm »
I changed a 3ds file and a texture, now displayed properly, and I wonder why I created this morning that 3dx file can not be displayed properly, and now I'll try the other.

39
Support / The question on the coordinate system (Loading 3ds)
« on: April 11, 2011, 12:18:59 pm »
      I have loaded the 3ds file and texture image , but there have some question which i can't resolve.
I think it is the same as this picturehttp://hi.csdn.net/space-3965048-do-album-picid-786468.html,
but it is like thishttp://hi.csdn.net/space-3965048-do-album-picid-786468-goto-down.html .

can you give me some suggestion ,If necessary, I will attach the source code

40
Support / Can you give me some suggestions you learn JPCT-AE
« on: April 10, 2011, 03:41:22 pm »
Thanks for your suggestion, I will work hard to learn JPCT-AE ;D

41
Support / Can you give me some suggestions you learn JPCT-AE
« on: April 10, 2011, 06:55:49 am »
Hello everybody, I ask where you can download more examples JPCT-AE, I would like to learn a good bit more JPCT-AE knowledge.
 ???

Pages: 1 2 [3]