Main Menu
Menu

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.

Show posts Menu

Messages - Schwapp

#1
lol, the  8) should be a  8 )^^
#2
Hello!
I splitted um my Code which created a simple Scene and a moveable character.
Before i splitted it up to more classes (like player, or scene...) the collision worked fine.
But now I get  the exception you see in the title :

Object3D.checkForCollisionEllipsoid(Unknown Source)

The whole exception says:

Exception in thread "main" java.lang.NullPointerException
   at com.threed.jpct.Object3D.checkForCollisionEllipsoid(Unknown Source)
   at WWWGame.Game.loop(Game.java:131)
   at WWWGame.Game.start(Game.java:81)
   at Start.init(Start.java:30)
   at Start.main(Start.java:16)


So there must be a variable in line 131 which is null... but there isn't.

Thats the line:

moveRes = szene.getPlayer().getObject().checkForCollisionEllipsoid(moveRes,
            ellipsoid, 8);

All variabled are defined and not null.
Any idea what the problem is?
#3
Support / Re: Collision problem
August 24, 2011, 04:03:55 PM
I discovered a new problem, the ground - collision works fine, but there's also a tree placed in the terrain file.
The Object3D just ignores the tree and walks right through...
I don't know how to solve it and I have no idea how somebody could help me, with these rare information...
#4
German corner / Re: Object3D MOVEIN?
August 20, 2011, 01:34:16 PM
Alles klar, vorwärts bewege ich mit:

character.translate(cam.getDirection());

rückwärts:

character.translate(-cam.getDirection().x,-cam.getDirection().y,-cam.getDirection().z);

nach links:

character.translate(-cam.getDirection().z,cam.getDirection().y,cam.getDirection().x);

nach rechts:

character.translate(cam.getDirection().z,cam.getDirection().y,-cam.getDirection().x);

Danke für die Hilfe!
#5
German corner / Object3D MOVEIN?
August 19, 2011, 07:42:56 PM
Hallo!
Hab' gerade den GermanCorner entdeckt :-)
Ich hoffe es stört niemanden, dass ich in so kurzer Zeit so viele Fragen habe...
Ich frage mich jetzt z.B. gerade, wie ich es schaffen kann, ein Object3D wie die Camera einfach in Blickrichtung zu bewegen.
Ich habe mir schon eine "fliegende" Kamera erstellt, die man mit den W,A,S,D - Tasten durch die Welt steuert und mit der Maus die Richtung bestimmt..
Dazu gibt es ja netterweise

moveCamera(Camera.CAMERA_MOVEIN, 1);

Das gibt es beim Object3D nicht, dass kann ich nur bewegen, indem ich es an der X (Y,Z) - Achse versetze...
Wenn man nun aber W drückt um nach vorne zu gelangen, hängt das ja von der Blickrichtung der Kamera ab...
Ich habe wirklich schon viel herumprobiert und nach den richtigen Methoden gesucht, es ist aber noch nichts brauchbares dabei herausgekommen...
Ich habe es vor recht langer Zeit mal mit der JMonkeyEngine geschafft, ist aber schon recht lange her...
Weiß jemand Rat?
#6
Support / Re: Collision problem
August 17, 2011, 05:38:37 PM
Again solved the problem, i've now done it to (2, 11, 2)
Thank you again  ;D
#7
Support / Collision problem
August 17, 2011, 12:46:06 AM
Hello again :)
Since the last problem was solved (thanks for that again) I got a new one.
I'm still working with a scene which has a terrain and a figure.
I'm trying out the Collision samples and have one problem:
When I say


private SimpleVector moveRes = new SimpleVector(0, 0, 0);
private SimpleVector ellipsoid = new SimpleVector(2, 2, 2);
private static final float DAMPING = 0.1f;
moveRes=character.checkForCollisionEllipsoid(moveRes, ellipsoid, 8);
character.translate(moveRes);
SimpleVector t = new SimpleVector(0, 1, 0);
t = character.checkForCollisionEllipsoid(t, ellipsoid, 1);
character.translate(t);
if (moveRes.length() > DAMPING) {
moveRes.makeEqualLength(new SimpleVector(0, 0, DAMPING));
} else {
moveRes = new SimpleVector(0, 0, 0);
}

and


character.setCollisionMode(Object3D.COLLISION_CHECK_SELF);
terrain.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);

it works not PERFECT.
The figure just falls half into the terrain.
Sorry, i can't explain it better in english, here a screenshot: http://imageshack.us/f/832/scr01o.png/
When  i don't use collisionModes, the figure just stands on top of the ground, whith collision it falls into the terrain...
#8
Support / Re: 3Ds loading Bug???
August 14, 2011, 10:37:37 PM
Eer, i took FrameBuffer.SAMPLINGMODE_HARDWARE_ONLY)
EDIT:
As i can see in the Version History of jPCT exists since 2004 (even longer i guess), why isn't it as well-known as the JMonkeyEngine or Ardor3D?
#9
Support / Re: 3Ds loading Bug???
August 14, 2011, 10:17:23 PM
Setting the maxPolysVisible before creating the world solved the problem!
Thanks a lot!!!
#10
Support / Re: 3Ds loading Bug???
August 14, 2011, 09:34:11 PM
Thanks for help,

I tried

Config.farPlane=3000;
,
Config.maxPolysVisible = 10000;
and
world.setClippingPlanes(1, 2000);
but the model still reduces itselv... i tried an other model, same effect.
The thing is, i have 2 Object3Ds, one is the terrain and one the character.
And only the caracter model reduces itselv, the terrain doesnt.
I just don't understand it
#11
Support / 3Ds loading Bug???
August 14, 2011, 02:07:40 PM
Hello!
I'm an absolutly beginner in jPCT and have a problem:
I'm trying to load a 3D Model which is exportet to .3ds from Blender.
So i load that model with a method from a tutorial:
private Object3D loadModel(String filename, float scale) {
Object3D[] model = Loader.load3DS(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) (-.5 * Math.PI));
temp.rotateMesh();
temp.setRotationMatrix(new Matrix());
o3d = Object3D.mergeObjects(o3d, temp);
o3d.build();
}
return o3d;
}

I downloaded the model there: http://e2-productions.com/repository/modules/PDdownloads/singlefile.php?cid=2&lid=161
But some parts of the model dissapear, depending on the camera-position.
An arm, the head or the whole body...
I never see the complete Figure, only peaces of it...

Any ideas?

Edit:
I see now, the figure just dissapears like every other Model, when the camera moves too far away.
But this model begins earlier to dissapear than the others do.