Parent/Child objects

Blitz3D Forums/Blitz3D Programming/Parent/Child objects

Fader(Posted 2003) [#1]
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


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


Fader(Posted 2003) [#3]
Thanks! Worked just like I needed.

Fader


Fader(Posted 2003) [#4]
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


DarkEagle(Posted 2003) [#5]
you using scaleentity or scalemesh at all?


Fader(Posted 2003) [#6]
No. SHould that make a difference?

Fader


Fader(Posted 2003) [#7]
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


Fader(Posted 2003) [#8]
So I guess the axis is not preserved when objects are saved as a group but NOT 'glued' together?

Thanks,
Fader


Mustang(Posted 2003) [#9]
One possibility is to use "pivots" - see my tankdemo (click the Blitz-link below on my signature).


Fader(Posted 2003) [#10]
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


Fader(Posted 2003) [#11]
Is there a way to manually set or move the axis of a mesh in Blitz Basic?

Thanks,
Fader


Bot Builder(Posted 2003) [#12]
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


Fader(Posted 2003) [#13]
I will try that.

Thanks,
Fader