EntityRadius

Blitz3D Forums/Blitz3D Beginners Area/EntityRadius


couldnt get it to work!


Because you haven't positioned the camera where you want it relative to the player.

camera=CreateCamera()
player=CreatePivot()
 PositionEntity player,0,1.5,0
 EntityRadius player,.2,1.5
 EntityType player,1
 CameraRange camera,.1,200
 cameraclscolor camera,250,250,245
 EntityParent camera,player
 PositionEntity camera,0,1,0,False

...the last line there moves the camera one unit up from its parent.

EDIT: EXAMPLE
Here's a camera, set high on a player entity, with markers so you can see what's going on... player's view top-right, and you will observe that it is set in the correct place as it sweeps under the doorframe.
Graphics3D 800,600,0,2
SetBuffer BackBuffer()

cam=CreateCamera()
CameraClsColor cam,250,250,245
PositionEntity cam,0,4,-10
headCam=CreateCamera()
CameraViewport headcam,GraphicsWidth()-256,0,256,256

player=CreatePivot()
PositionEntity player,0,1.5,1
EntityRadius player,.2,1.5
EntityType player,1
CameraRange headCam,.1,200
CameraClsColor headCam,220,220,215
EntityParent headCam,player
PositionEntity headCam,0,1.3,0,False

playerMarker=CreateSphere(8,player)
ScaleEntity playerMarker,.2,1.5,.2
EntityColor playerMarker,100,200,200

headCamMarker=CreateSphere(8,headCam)
ScaleEntity headCamMarker,.1,.1,.1
EntityColor headCamMarker,200,50,50
PositionEntity headCamMarker,0,0,.1

ground=CreatePlane()
Line 0,0,0,31 : Line 0,0,31,0
groundTex=CreateTexture(32,32)
CopyRect 0,0,32,32,0,0,BackBuffer(),TextureBuffer(groundTex)
EntityTexture ground,groundTex

beam=CreateCube()
ScaleEntity beam,1,.1,.1
EntityColor beam,50,200,50 
PositionEntity beam,0,3.1,0

beam2=CreateCube()
ScaleEntity beam2,.1,1.5,.1
EntityColor beam2,50,200,50 
PositionEntity beam2,-.9,1.5,0

beam3=CopyEntity(beam2)
PositionEntity beam3,.9,1.5,0

While Not KeyHit(1)
TurnEntity player,0,1,0
MoveEntity player,0,0,.1

PointEntity cam,player
RenderWorld
Flip
Wend