MeshHandel
Blitz3D Forums/Blitz3D Programming/MeshHandel
| ||
hi my problem: i load a box (b3d format) and display it. position it and save the posx,posy and posz. now i create a BlitzCube (Createcube, witch has by default the same size like the model.) now if i position the blitzcube on the same (!) positions like the model, there is the Y-Position the half meshheight lower... god knows why... x- and z-axis are right... .. any ideas? P.S.: for a better understanding: The textured one is the model an the blue one is the blitzcube. |
| ||
Check that your pos variables are floats, you are 0.5 out so its a float/int problem. |
| ||
Maybe your bed format (whatever that is?) box has its Y axis vertex data ranging from 0 to 2 for some reason. In any event you can shift the blitz cube or the box so they match. See positionmesh. |
| ||
Also, meshes have a kind of 'handle - point' (Im not techy okay!) This is a pivotal point that maybe the centre of the mesh, or anywhere else - even outside the mesh. This pivotal point is placed at the position secified with positionentity, although the actual cube maybe displaced from this. If this is the case, perhaps assigning a parental pivot the correct distance away and positioning that instead may help |
| ||
Hmmmm. Guess not. Oh...I thought from the post title that this was going to be about musical meshes. Handels Meshiah???? |
| ||
I would guess that you created the cube in your favourite modeller just over the grid.. (with the lower faces just touching the grid plane) So the model then naturally has the mesh handle on the lower faces. And the blitz box is created with a handle in the middle of the mesh. Thats my guess.. nothing wrong with blitz positions in all my testing at least.. its all dependant on how you save the model. |
| ||
Just as an idea.You said you positioned the b3d model,got the models position,then created a cube and positioned the cube to those coords of the b3d model...... Why not just parent the cube ( created one ) to the B3d model and this way were ever you position the b3d model the blue cube will be sure to fallow. If the two don't line up then look at what ASHMANTLE said,your b3d models mesh is proboly shiffted from default world coords 0,0,0 as this is where Blitz will create the cube.Remember you positioning the ENTITY not the MESH. In this example think of (A) as your loaded b3d mesh. Graphics3D 640,480,16,2 SetBuffer BackBuffer() C=CreateCamera() PositionEntity C,0,0,-15 A=CreateCone() PositionEntity A,0,+5,0 B=CreateCube(A) WireFrame True While Not KeyHit(1) If KeyHit(200) PositionEntity A,0,+5,0 If KeyHit(208) PositionEntity A,0,-5,0 RenderWorld Flip Wend |
| ||
hehe... thx for all the relpys. i'm on th work right now, so i can't test it, but i'd bet my money on AshMantle's advice... . thanks all - let you know what it was. P.S.: because the 'bed' format. it was around 3 in the morning ofer here (europe) nad i was a lil tired.... so i meant b3d-format (well since i was tired, .bed format would be that false. hehe) |