Creating hollow cube

Hello, currently I have created a cube (using Box) and I am trying to put another box inside of it. I was wondering if someone could offer any guidance or possibly tutorials I haven’t seen on how I would create another cube inside of the first cube. Thanks for any help.

What is the issue with creating one cube and then another slightly smaller cube?



What is the effect you are trying to get?

Well at the moment it seems like the first cube I created is solid and cannot have other objects implemented inside of it. I am trying to put objects into a cube, and that is it. Eventually I want to add collision detection and physics, but want to complete this part first. Example of what I am trying to achieve would be to create a large cube as if it is a room. After that create a dice that I could toss around in that room and it would bounce off the walls.

So you want a regular box on the outside and an inside-out box on the inside? There is no built in class for an inside-out-box as far as I’m aware… you’d have to do it as a custom mesh (though it’s pretty trivial to reuse most of the code from regular box).



Getting physics to work right in that might be the tricky part. Could be better just to model the six sides separately.

Alright, thanks. I assume this is the document I should look at to create a custom cube? https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:custom_meshes

Not very familiar with 3D programming at all, sorry.

That’s the best place to start. It may or may not help with physics as I’m not really familiar with how those collision meshes would be generated for a hollow object. It would definitely work for six separate walls, though.

To be honest though you would be better off modelling your room(or at least the walls) in Blender or similar.

Do yo know about the normals? You will only be able to see the faces of the boxes which have normals pointing towards the camera… http://en.wikipedia.org/wiki/Normal_%28geometry%29

@javagame said:
Do yo know about the normals? You will only be able to see the faces of the boxes which have normals pointing towards the camera... http://en.wikipedia.org/wiki/Normal_%28geometry%29


Normals are for lighting. Winding order is for facing.

I have no idea what bullet uses to generate a collision mesh but my assumption is winding order also.

Does bullet support “hollow” objects though? Something like an inwards facing cube has infinite outer bounds.

@zarch said:
Does bullet support "hollow" objects though? Something like an inwards facing cube has infinite outer bounds.


True. I guarantee you that I know less about bullet than you do. :)

As far as i know the bullet binding uses a box shape if a box mesh is detected, wich results ina massive block geometry. If you use a meshshape on the other hand you get a paper thin cube. But loose the ability to move it freely around. If you ue a gImpact mesh you get the same, but can move it around at a higher cpu load.

@pspeed said:
True. I guarantee you that I know less about bullet than you do. :)

It seems unlikely. We are probably both tied at "minimal" levels of knowledge :D

If its a mesh collision shape it will be hollow anyway. Boxes and other mvable shapes, nope.

So at the moment I have the front and back of the cube created, but I was confused on how I would create the sides of the cube. I followed the custom mesh document which made it really easy to create the front and back. I found a slide show (created my normen, thanks) about basic vector math and quaternions. Would I need to create the sides of the vectors and rotate them using quaternions in order to create my sides, or is there an easier way?



Ignore this post, managed to get them set up using quaternion. On to physics and collision!