Unable to create a simple cup-like hollow cylindrical shape

Hi



I am new to this and I really appreciate your help.



I am trying to create a cup-like hollow shape, on which I can eventually aim and throw paper balls at. Just a basic game (like a paper toss). But, needs physics and shapes and collisions.



But anyways, I am trying to set up a cylinder that looks like a hoop.



The problem is…when I set up a hollow cylinder, I am not able to see the inside of the cylinder. It is blacked out.



This is what I am seeing…

http://i.imgur.com/D0SGl.jpg



I want it to look like (ultimately)…

http://www.proindexes.com/images/recycle/trash-can-round.jpg



I would really appreciate your help on this effort.



Thanks

Setting the culling to off might do the trick. Else, give it some thickness as a model.

1 Like
@memonick said:
Setting the culling to off might do the trick.


which you can adjust with:

[java]material.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off);[/java]
2 Likes

thank you guys.



Setting the culling to ‘OFF’ helped with the visual perspective of the cylinder.



However, now I am running into a different issue…



As I had mentioned before, I am setting up a hollow cylinder as so:



Cylinder cup = new Cylinder(samples, samples, cupBottomRadius, cupTopRadius, cupHeight, false, true);



So, for the purpose of my game, I used the ‘Hello Physics’ tutorial and created such a hollow a cylinder on the floor, successfully.



However, after giving the cylinder rigidbodycontrol as so:



Geometry cup_geo = new Geometry(“Cylinder”, cup);

cup_phy = new RigidBodyControl(25f);

cup_geo.addControl(cup_phy);

bulletAppState.getPhysicsSpace().add(cup_phy);



When I attempt shooting spheres (balls) at this cylinder, they are bouncing right off the top surface of the cylinder…



I was expecting, as it is a hollow cylinder, the ball would fall in the cylinder.



Thanks sooo much for your help so far. I really appreciate your help on this…

The visual representation of the Cylinder, even if the top is black, is still a SOLID cylinder. It’s not a tube.



I would personally opt for a model. A whole less hassle.

As madjack says, also you should look up convex polyhedra on google. A lot (like, almost all) collision algorithms assumes convex shapes. So you will not find a 1-step object that is a wastebasket. You will have to model it using compound shapes or do what computer games usually do - fake it :slight_smile: