EntityRadius()

Blitz3D Forums/Blitz3D Beginners Area/EntityRadius()

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.

Well, i don't think you can, you'd need a variable to keep track of it, but if you do

rad=2
entityraduis sphere,rad


Then just create a sphere and scale it by the rad value.

Try this:

Graphics3D 800,600
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,0,-10

light=CreateLight()

s=CreateSphere()
radius=CreateSphere(8,s)
PositionEntity radius,0,0,0
EntityColor radius,50,50,180
EntityAlpha radius,0.5

rad#=1

s1=CreateSphere()
PositionEntity s1,5,0,0

EntityType s,1
EntityType s1,2

Collisions 1,2,1,1


While Not KeyHit(1)

	If KeyDown(205) Then MoveEntity s,0.2,0,0
	If KeyDown(203) Then MoveEntity s,-0.2,0,0
	
	If KeyHit(200) Then
		rad=rad+0.2
		EntityRadius s,rad
		ScaleEntity radius,rad,rad,rad
	End If
	If KeyHit(208) Then
		rad=rad-0.2
		EntityRadius s,rad
		ScaleEntity radius,rad,rad,rad
	End If
	
	
	UpdateWorld
	RenderWorld
	Text 0,0," Press up and down to adjust collision radius. Left and right to move sphere"
	Flip
Wend
End