Pointentity Problem

Blitz3D Forums/Blitz3D Programming/Pointentity Problem

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.

Cones are created pointing upwards along the positive Y axis. PointEntity points the entity along the positive Z axis. You will need to use RotateMesh to rotate the cone 90 degrees on the X axis for it to be pointing in the correct direction.

eg. RotateMesh cone, 90.0, 0.0, 0.0

As I understand it, the roll parameter of PointEntity just rotates the source entity on its local Z axis, which is probably not something you are going to need.

Global timer = CreateTimer( 25 )

Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()

Global cam = CreateCamera()
CameraZoom cam, 1.6
MoveEntity cam, 2.0, 2.0, -10.0

Global light = CreateLight()

Global cone = CreateCone()
RotateMesh cone, 90.0, 0.0, 0.0
UpdateNormals cone

Global cube = CreateCube()
UpdateNormals cube
PositionEntity cube, 20.0, 10.0, 40.0

While Not KeyHit( 1 )

MoveEntity cube, -0.22, 0.0, 0.0

PointEntity( cone, cube )
MoveEntity cone, 0.0, 0.0, 0.3

UpdateWorld
RenderWorld
Flip

WaitTimer( timer )

Wend

End