Parent/Child objects
Blitz3D Forums/Blitz3D Programming/Parent/Child objects
| ||
Does the FINDCHILD function work with parent and child relations built in the 3D app (Truespacde)? Or does it only work with child objects appened manually in BlitzBasic? Thanks, Fader |
| ||
It works with parent-child relationships setup in your modeling tool. The data must of course be carried over correctly (ie. exported to 3ds with separate objects kept separate) and you must load the mesh using LoadAnimMesh. |
| ||
Thanks! Worked just like I needed. Fader |
| ||
One more thing. I am making a vehicle with a turret. I know that the turret's axis is at the center of the round part of the turret. However, when loaded in BlitzBasic, the axis moved to the center of the turret and cannon. ANy idea how I can keep the axis where I designed it inthe Truespace? Thanks, Fader |
| ||
you using scaleentity or scalemesh at all? |
| ||
No. SHould that make a difference? Fader |
| ||
I made sure there is no scaling. Still the position of the axis is moved to the center of the child object. Any one experience this before? truck=LoadAnimMesh("models/truckall.3ds") ;ScaleMesh truck,3,3,3 turret=FindChild(truck,"Turret") EntityColor turret,255,0,0 RotateEntity turret,90,0,0 Thanks, Fader |
| ||
So I guess the axis is not preserved when objects are saved as a group but NOT 'glued' together? Thanks, Fader |
| ||
One possibility is to use "pivots" - see my tankdemo (click the Blitz-link below on my signature). |
| ||
What I did before was to load the tank and the turret as separate objects from separate files. Then I would attach the turret as a child through BB3D code...and that would work. I guess I liked the idea of being able to build the tank in my 3D app and just have BB3D load it in as a single object with out all the extra steps to attach all the pieces. Fader |
| ||
Is there a way to manually set or move the axis of a mesh in Blitz Basic? Thanks, Fader |
| ||
MoveMesh entity,-axisX,-axisY,-axisZ This moves the mesh, without moving the axis. You have got to remember to reposition your axis like this however: Moveentity entity,axisX,axisY,axisZ |
| ||
I will try that. Thanks, Fader |