lost children

Blitz3D Forums/Blitz3D Beginners Area/lost children

Rook Zimbabwe(Posted 2004) [#1]
OK what is a child? Why use child? (no poetry about children please!) : )
-RZ


Warren(Posted 2004) [#2]
In what context?


Ross C(Posted 2004) [#3]
A child is what an entity is after your parent it to another.

pivot = CreatePivot()

camera = CreateCamera()

EntityTexture camera,pivot



The camera is now a child of the pivot. What ever happens basically to the pivot, will affect all it's "children".

You could say place the pivot at the characters location, then move the camera away from the pivot. Then rotate the pivot, and the camera will swing round, like an orbiting planet.

Small demo

Graphics3D 800,600
SetBuffer BackBuffer()

light=CreateLight()

pivot=CreatePivot()

camera=CreateCamera()
EntityParent camera,pivot
PositionEntity camera,0,0,-5

cube=CreateCube()

While Not KeyHit(1)


	If MouseDown(1) Then MoveEntity camera,0,0,1
	If MouseDown(2) Then MoveEntity camera,0,0,-1
	
	If KeyDown(203) Then TurnEntity pivot,0,1,0
	If KeyDown(205) Then TurnEntity pivot,0,-1,0
	
	
	UpdateWorld
	RenderWorld
	Text 0,0," MOUSE BUTTON 1 : Move camera forward"
	Text 0,10," MOUSE BUTTON 2 : Move camera backwards"
	Text 0,20," LEFT ARROW key and RIGHT ARROW key : turn the pivot
	Flip
Wend
End




Rook Zimbabwe(Posted 2004) [#4]
So thats how you get the CAM view on your character in some of those games... the camera is a child of the car or the hero (a la nintendoesque!) that does explain it for me. Thanks I was wondering.
-RZ