[handle=] CreateSpritePivot([maincamera][,distance#])

Parameters

maincamera (optional) - handle of camera to attach the sprite camera to
distance (optional) - sets the distance to place the sprite pivot away from main (attached) camera.
The default distance value is 1.0

Description

** This is the one of the most important commands in the Sprite Control system **

You can use this function if you wish to set up your own display instead of the SpriteGraphics3D command.
First, create a 3D display, then a camera. After that use this function to attach a sprite pivot to the main camera.
Once this is done, all future loaded/created sprites will be attached to the pivot.

Some important notes to observe:

The command must be called AFTER setting up the 3d screen and camera
The command must be called BEFORE loading or creating 3D quad sprites

The optional maincamera parameter only needs to be given if you are going to move the main camera around.
The optional distance parameter sets the distance of the sprite pivot from the attached camera. Default value is 1.0
You may have to increase this a little if you get sprite flickering. Use something like 1.001
Do not use values lower than 1.0 otherwise the atached sprites will disappear.

See also: SpriteGraphics3D CameraZoom3D

Example

Include "Sprite Control.bb"

Graphics3D 640,480
SetBuffer backBuffer()
cam=CreateCamera()
piv=CreateSpritePivot(cam)

mysprite=LoadImage3D("myimage.bmp")
DrawImage3D mysprite,200,180

RenderWorld
Flip
WaitKey()
End


Index