XITH 3d Collision tutorial, help, piece of code

Hi i don’t know the way for use this Package com.xith3d.collider with a simple cube and camera.

Where i can find a good tutorial or some help.

Thanks !

no tutorial or help I’m afraid, and I can’t help you either (as I don’t use that package for my collision)

The best you have is an example:
src/com/xith3d/test/Xith3DCollisionDropTest

JWS: http://xith.org/jws/jws-com.xith3d.test.Xith3DCollisionDropTest.jnlp

You can also read the javadoc - and the source code itself.

Will.

also,

check out odejava it does collision & physics.

Will.

You might want to take a look at the source code for David Yazel’s Quake 3 level loader demo:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=xith3d;action=display;num=1074907427;start=11#11

It uses the collider package with a dummy avatar node used for movement of the camera and collisions with other geometry in the system. You’ll have to pick through the code to figure out exactly what you need, which may be a little confusing, but it should make sense after you get it sorted out.

thanks i look that :slight_smile:

ok, i understand how to add a collision box to my cube, but i don’t understand how to detect collision evenement.

Code for my cube :
// COLLISION
private com.xith3d.collider.CollisionSystem cs;
private com.xith3d.collider.ColliderNode sphereColliderNode;
private com.xith3d.collider.ColliderNode blockColliderNode;

public Engine(){


// Collision
cs = new com.xith3d.collider.CollisionSystem(-1);

public void addBlock(String fileName,float x, float y, float z){
// Creer Cube
// Chargement des textures, Si pas de texture erreur
textureCube = (com.xith3d.scenegraph.Texture2D)tl.getMinMapTexture(“model/”+fileName);
com.xith3d.scenegraph.Geometry geotmp = createCubeViaTriangles(x, y, z, 1);
com.xith3d.scenegraph.Appearance a = new com.xith3d.scenegraph.Appearance();
a.setTexture(textureCube);
com.xith3d.scenegraph.Shape3D shtmp = new com.xith3d.scenegraph.Shape3D(geotmp, a);
objRotate.addChild(shtmp);

    // COLLISION
    shtmp.setName("cube_"+x+"_"+y+"_"+z);
    com.xith3d.collider.ColliderGeometry cg = new com.xith3d.collider.ColliderGeometry();
    cg.setModel(shtmp);
    com.xith3d.collider.BiTreeCollider bic = new com.xith3d.collider.BiTreeCollider();
    bic.build(cg);
    blockColliderNode = new com.xith3d.collider.ColliderNode(shtmp,com.xith3d.collider.ColliderNode.CT_GEOMETRY,com.xith3d.collider.ColliderNode.CT_GEOMETRY,false,bic);
    cs.addCollider(blockColliderNode);
}

} // end engine

I think my cube have now a box collision?
Can i make the same for the Camera com.xith3d.scenegraph.View() ?

Thanks !

I look odejava, that realy good !
I tested ,and work fine.
Just more clipping in render mode, the render it’s very slow.
Their a config to perform render?