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.


Topics - quixote_arg

Pages: [1]
1
Support / Object3D IDs and Names
« on: March 27, 2006, 08:05:55 pm »
Hi, I'm doing a simple 3D viewer, based on the FPS demo.

The player can throw a ball, and if the ball hits something relevant in the world, something happens. This is done as an Applet.

The first time everything goes well, but if I reload the page, object ID's and names change, so the code that checks if the ball has hitten something relevant stops working.

So, questions:

a) How to uniquely identify an Object3D?
or
b) How to dispose things in JPCT so that the next time the applet gets loaded the IDs and names are the same?

Thanks a lot

Tulsi

2
Support / Texture tiling on plane
« on: February 07, 2006, 09:18:38 pm »
Hi!

I've created a plane using Primitives class. When I apply a texture, it strechtes it all over it. I would like the texture to be tiled on the object. Is there an easy way to do this? I searched the forum, with no luck...

Here's the code:

Code: [Select]

wall = Primitives.getPlane(15, 20);
wall.setOrigin(new SimpleVector(800, -150, -300));        wall.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
wall.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
wall.setTexture("wall");
theWorld.addObject(wall);


Thanks

3
Support / Textures in applets
« on: January 23, 2006, 03:12:55 pm »
Hi, I'm trying to make a simple applet based on the FPS code. The world so far consists only of a floor and a wall. I try to apply a brick like texture to the wall but it renders bad.

This is the texture I'm using:


And this is a screenshot of the result:


Here is the code of how the wall is initialized:

Code: [Select]

        wall = Primitives.getBox(150f, 0.01f);
        wall.rotateY((float) Math.PI / 4);
        wall.rotateX((float) Math.PI / 2);
        wall.setOrigin(new SimpleVector(800, -75, -300));
        wall.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
        wall.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
        wall.setTexture("wall");
        wall.setEnvmapped(Object3D.ENVMAP_ENABLED);
        wall.setEnvmapMode(Object3D.ENVMAP_CAMERASPACE);
        theWorld.addObject(wall);


And here is the initialization of the FrameBuffer:

Code: [Select]

        buffer = new FrameBuffer(width, height, FrameBuffer.SAMPLINGMODE_NORMAL);
        buffer.enableRenderer(IRenderer.RENDERER_SOFTWARE,
                IRenderer.MODE_OPENGL);
        buffer.setBoundingBoxMode(FrameBuffer.BOUNDINGBOX_NOT_USED);

        buffer.optimizeBufferAccess();


Any ideas why is this happening?

Thanks a lot

4
Support / Sphere collision and radius
« on: January 18, 2006, 08:59:22 pm »
Hi, I have a question.

I've created an sphere Object3D with the Primitives class. Something like:

Code: [Select]
Object3D bullet = Primitives.getSphere(0.5f);

When I want to try collision of that object, naturally the checkForCollisionSpherical method seems to be the most appropiate.

However: the checkForCollisionSpherical takes a float as a radius but the getSphere method of the Primitives class takes a float with the scale of the sphere.

How are these two values related with each other?

I mean: what is the radius for a sphere created with Primitives in order to make the collision sphere optimal?

Thanks

Pages: [1]