Get size of loaded model

Hey guys,

does anybody know how i can get the size of loaded model (.OBJ)?? (width, height, length)
I already can read out the center of the spatial with [java]spatial.getWorldBound().getCenter();[/java].
I think what im searching for are xExtent, yExtent and zExtent of the BoundingVolume. But where i can find them?

I want to learn more about jme3 and think of program an Minecraft similiar Game, just the basics. I want to place the boxes with this method of calculating the position, size and so on

Sorry for my bad english.

Its mostly a BoundingBox unless you set something else, so you can do:
[java]BoundingBox box = (BoundingBox)spatial.getWorldBound();[/java]

2 Likes

Thank you !

A few “minecraft” related pages, which i stumpled upon, which may be on use:

http://codeflow.org/entries/2010/dec/09/minecraft-like-rendering-experiments-in-opengl-4/
http://www.sea-of-memes.com/LetsCode1/LetsCode1.html

To the OP, you do understand that block-world games are harder to make than regular games… not easier, right? Just because the graphics look simplified does not mean they are easier to make.

Also, block worlds are not made of blocks. You will only be able to make a teeny tiny world that way.

And by “teeny tiny” I mean that 10x10x10 will probably be too big.

Ooooh… you mean THAT kind of box. Boy, did my mind go someplace else.

I could hear my hubby now… “Why did you make the entire world out of dead squirrels?”

To the OP: Someone posted a plugin that you could sift through for reference on how this is accomplished. Lemme check on the specifics…

zzzzzSimpleBloxelWorld submitted by @zzuegg - His stuff is always cool. Install the plugin and take a look through the code. Should give you a proper direction to go in.

thanks normen :smile: