cant get x,y,z co-ords of child

Blitz3D Forums/Blitz3D Programming/cant get x,y,z co-ords of child

slenkar(Posted 2007) [#1]
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?


Gabriel(Posted 2007) [#2]
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.


slenkar(Posted 2007) [#3]
sorry, forgot to mention, I tried that,
but it always returns 10,10,10 - the position of the parent


GfK(Posted 2007) [#4]
Its most likely a problem with the way wings has exported the model. Had similar problems using .X format meshes exported from lightwave.


slenkar(Posted 2007) [#5]
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


caff_(Posted 2007) [#6]
I'd imagine UU3D should work.. if not try milkshape?


Gabriel(Posted 2007) [#7]
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.


b32(Posted 2007) [#8]
You could try this function. It might not work in all circumstances, but maybe you can tweak it a bit:



Gabriel(Posted 2007) [#9]
Yep, that's how I did it in the end. It's fine if all your objects are generally centered around their geometric center.


slenkar(Posted 2007) [#10]
great thanks, ill check it out


octothorpe(Posted 2007) [#11]
				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)

?


b32(Posted 2007) [#12]
Erm .. yes .. sorry, I will edit it. Thanks!