cant get x,y,z co-ords of child
Blitz3D Forums/Blitz3D Programming/cant get x,y,z co-ords of child| 
 | ||
| I created a level in wings3d, exported to OBJ then imported into UU3D and exported to B3D format. When I click on a child entity (like a barrel or crate) I can get it to move using moveentity but when I use entityX it always returns the position of the level mesh itself. can anyone help? | 
| 
 | ||
| EntityX has a parameter to return the global position.  EntityX# ( entity[,global] ) It defaults to false, so you'll need to specify true for a global position. | 
| 
 | ||
| sorry, forgot to mention, I tried that, but it always returns 10,10,10 - the position of the parent | 
| 
 | ||
| Its most likely a problem with the way wings has exported the model.  Had similar problems using .X format meshes exported from lightwave. | 
| 
 | ||
| it seems that wings puts the child's entity at 0,0,0, and the child's mesh at the co-ordinates specified does anyone know of a program that places the child's entity at the same location as its mesh? ill try UU3d | 
| 
 | ||
| I'd imagine UU3D should work.. if not try milkshape? | 
| 
 | ||
| Ah yes, I've had this problem with meshes exported from 3dsMax too. I can't remember if I was exporting via UU3D or B3D Pipeline at the time, but yep, it's definitely an export issue, and it seems to be a common one. | 
| 
 | ||
| You could try this function. It might not work in all circumstances, but maybe you can tweak it a bit: | 
| 
 | ||
| Yep, that's how I did it in the end. It's fine if all your objects are generally centered around their geometric center. | 
| 
 | ||
| great thanks, ill check it out | 
| 
 | ||
| x# = VertexX(surf, j) y# = VertexX(surf, j) z# = VertexX(surf, j) should be x# = VertexX(surf, j) y# = VertexY(surf, j) z# = VertexZ(surf, j) ? | 
| 
 | ||
| Erm .. yes .. sorry, I will edit it. Thanks! |