As a different approach to constructing my maze I decided I'd make the corridor pieces and slot them in place depending on the map array.
So an area like this:
11111
00X00
11011
Would have a junction model at the X and suitably rotated corridor objects at the 0s (and nothing at the 1s)
However when doing this, for some reason whenever I rotate my asymmetrical junction models (basically just being one wall) they shift about and don't rotate around their origin.
Here is the model relative to the origin in Deled:
(The dark blue lines showing the X and Z axes and their intersection being the origin in all 3 axes.)
(I export the model as .x and import into Milkshape3D to export as .3ds (after mirroring in the Y axis) )
When I put the model into the actual game I get these kind of results:
(The horizontal polygon is merely there to show the offset and because I tried testing it by making vertices on symmetrical sides of the origin (to no avail of course))
And it's even more obscure when I've rotated a quarter turn. :S
I've tried omitting the build method or the compile and strip method. I've tried manually calculating the rotation pivot and the object center (neither of which changed anything)
So I'm kind of stuck now...
I simply can't do what seems an almost trivial task. xD
All the code affecting any one object in the game set up:
blocks[bindex]=wallDummy.cloneObject();
blocks[bindex].setTexture(wallTex);
blocks[bindex].rotateY(-(float)Math.PI/2); // Or some other angle if it's a different junction block
blocks[bindex].setSpecularLighting(true);
blocks[bindex].translate(i*20,0,j*20);
blocks[bindex].setRenderHook(genericNormalMapping);
blocks[bindex].setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
blocks[bindex].compileAndStrip();
world.addObject(blocks[bindex]);
bindex++;
And wallDummy is retrieved like this:
type="3ds";
path="wall";
wallDummy=Object3D.mergeAll(Loader.load3DS("res/"+type+"/"+path+"/"+path+".3ds",0.125f));
wallDummy.build();
tm.addTexture(path+"Tex",new Texture("res/"+type+"/"+path+"/"+path+".png"));
tm.addTexture(path+"TexN",new Texture("res/"+type+"/"+path+"/"+path+"N.png"));
wallTex=new TextureInfo(tm.getTextureID(path+"Tex"));
wallTex.add(tm.getTextureID(path+"TexN"),TextureInfo.MODE_MODULATE);