Parenting

BlitzMax Modules Forums/MiniB3D/Parenting

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi there,

could someone experienced with B3D tell me if the following code is

a) plain wrong
b) a bug with miniB3D

Strict

Import "../MiniB3D.bmx"

Type TSun
Field PIVOT:TPivot
Field MESH:TMesh
Field LIGHT:TLight

Function Create:TSun()
	Local tmp:TSun = New TSun
	tmp.PIVOT = CreatePivot()
	tmp.MESH = CreateSphere(8,tmp.PIVOT)
	tmp.LIGHT = CreateLight(1,tmp.PIVOT)
	tmp.LIGHT.LightColor(255,20,20)	
	Return tmp
End Function
End Type

Local width=640,height=480,depth=16,mode=0

Graphics3D width,height,depth,mode

HideMouse()

Local cam:TCamera=CreateCamera()
cam.PositionEntity(0,0,-10)

Local Sun:TSun = TSun.Create()
Sun.MESH.ScaleEntity(3,3,3)
Sun.PIVOT.PositionEntity(0,0,20)

While Not KeyDown(KEY_ESCAPE)	
	
	RenderWorld
	
	Text 0,0,"Light: "+Sun.LIGHT.px+", "+Sun.LIGHT.py+", "+Sun.LIGHT.pz
	Text 0,20,"Mesh : "+Sun.MESH.px+ ", "+Sun.MESH.py+ ", "+Sun.MESH.pz
	Text 0,40,"Pivot: "+Sun.PIVOT.px+", "+Sun.PIVOT.py+", "+Sun.PIVOT.pz	

	Flip	
Wend


This never moves the Children to where the parent(pivot) is.