i need help in Collision

i want to make Collision detection that make the view point not go on any object

i make a simple program tat contain only one object Cylinder i want to make collision where the view pont when hit the object not go inside it i want it to stop

this is my code

publicclass Hello4extends Applet

{

Texture2D texture;

public Hello4()

{

setLayout(new BorderLayout());

GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();

Canvas3D canvas3D =new Canvas3D(config);

add(canvas3D,BorderLayout.CENTER);

BranchGroup scene = createSceneGraph();

scene.compile();

SimpleUniverse simpleu =new SimpleUniverse(canvas3D);

simpleu.getViewingPlatform().setNominalViewingTransform();

simpleu.addBranchGraph(scene);

}

public BranchGroup createSceneGraph()

{

BranchGroup objroot =new BranchGroup();

TextureLoader loader =new TextureLoader("house_auto_mosaic1.jpg",this);

ImageComponent2D image = loader.getImage();

//System.out.println(" width "+image.getWidth());

texture =new Texture2D(Texture.BASE_LEVEL,Texture.RGB,image.getWidth(),image.getHeight(),1);

texture.setImage(0,image);

texture.setEnable(true);

Appearance appear =new Appearance();

appear.setTexture(texture);

Cylinder cy =new Cylinder(0.70f,3.50f,Primitive.GENERATE_TEXTURE_COORDS,appear);

//TextureAttributes mta = new TextureAttributes();

Transform3D rotate =new Transform3D();

rotate.rotY(Math.toRadians(45));

rotate.setTranslation(new Vector3d(0,0,-15));

TransformGroup objrotate =new TransformGroup(rotate);

objrotate.addChild(cy);

objroot.addChild(objrotate);

return objroot;

}

}

[2670 byte] By [rehaba] at [2007-10-2 11:04:33]
# 1

@OP

I suggest posting this in the [url=http://forum.java.sun.com/category.jspa?categoryID=9]Multimedia and Imaging APIs[/url] section. If you do so, please provide a link in this thread to that post, so people know it has been moved and won't answer in this one which may already have been answered elsewhere.

And try formulating a question, for I am unable to extract one from this post.

Good luck.

prometheuzza at 2007-7-13 3:38:08 > top of Java-index,Java Essentials,New To Java...