Xors3d Engine
3D Lines

Functions

BBDECL void BBCALL xClearLine3D (x3DLine *line3d)
 Deletes all the 3d line's nodes.
BBDECL x3DLine *BBCALL xCreateLine3D (float fromX, float fromY, float fromZ, float toX, float toY, float toZ, int red=255, int green=255, int blue=255, int alpha=255, bool useZBuffer=true)
 Creates a 3d line and returns a handle.
BBDECL void BBCALL xDeleteLine3DNode (x3DLine *line3d, int index)
 Deletes a specified 3d line's node.
BBDECL int BBCALL xGetLine3DUseZBuffer (x3DLine *line3d)
 Returns true if Z-buffering is enabled. Returns false otherwise.
BBDECL void BBCALL xLine3DAddNode (x3DLine *line3d, float x, float y, float z, bool isGlobal=false)
 Adds a node to the end of the line.
BBDECL int BBCALL xLine3DAlpha (x3DLine *line3d)
 Returns an alpha value of a 3d line.
BBDECL int BBCALL xLine3DBlue (x3DLine *line3d)
 Returns a blue value of a 3d line's color.
BBDECL void BBCALL xLine3DColor (x3DLine *line3d, int red, int green, int blue, int alpha)
 Sets a new color and alpha of a 3d line.
BBDECL int BBCALL xLine3DGreen (x3DLine *line3d)
 Returns a green value of a 3d line's color.
BBDECL void BBCALL xLine3DNodePosition (x3DLine *line3d, int index, float x, float y, float z, bool isGlobal=false)
 Sets a new position of a node.
BBDECL int BBCALL xLine3DNodesCount (x3DLine *line3d)
 Returns the number of the nodes in a 3d line.
BBDECL float BBCALL xLine3DNodeX (x3DLine *line3d, int index, bool isGlobal=false)
 Returns the X coordinate of a 3d line's node.
BBDECL float BBCALL xLine3DNodeY (x3DLine *line3d, int index, bool isGlobal=false)
 Returns the Y coordinate of a 3d line's node.
BBDECL float BBCALL xLine3DNodeZ (x3DLine *line3d, int index, bool isGlobal=false)
 Returns the Z coordinate of a 3d line's node.
BBDECL void BBCALL xLine3DOrigin (x3DLine *line3d, float x, float y, float z, bool isGlobal=false)
 Sets a new origin of the 3d line.
BBDECL float BBCALL xLine3DOriginX (x3DLine *line3d, bool isGlobal=false)
 Returns the starting X coordinate of a 3d line.
BBDECL float BBCALL xLine3DOriginY (x3DLine *line3d, bool isGlobal=false)
 Returns the starting Y coordinate of a 3d line.
BBDECL float BBCALL xLine3DOriginZ (x3DLine *line3d, bool isGlobal=false)
 Returns the starting Z coordinate of a 3d line.
BBDECL int BBCALL xLine3DRed (x3DLine *line3d)
 Returns a red value of a 3d line's color.
BBDECL void BBCALL xLine3DUseZBuffer (x3DLine *line3d, bool state)
 Changes the use of Z-buffering.

Function Documentation

BBDECL x3DLine* BBCALL xCreateLine3D ( float  fromX,
float  fromY,
float  fromZ,
float  toX,
float  toY,
float  toZ,
int  red = 255,
int  green = 255,
int  blue = 255,
int  alpha = 255,
bool  useZBuffer = true 
)

Creates a 3d line and returns a handle.

3d line is an Entity. It can be parented.

Note:
At the beginning a 3d line has 1 node: the line lies between the origin and the node #0.
Parameters:
fromXStarting X coordinate
fromYStarting Y coordinate
fromZStarting Z coordinate
toXEnding X coordinate
toYEnding Y coordinate
toZEnding Z coordinate
redRed value of the color. Default value is 255.
greenGreen value of the color. Default value is 255.
blueBlue value of the color. Default value is 255.
alphaAlpha value. Default value is 255.
useZBufferTrue to use Z-buffering. Default value is True.
BBDECL void BBCALL xLine3DOrigin ( x3DLine *  line3d,
float  x,
float  y,
float  z,
bool  isGlobal = false 
)

Sets a new origin of the 3d line.

Parameters:
line3d3D Line handle.
xX coordinate.
yY coordinate.
zZ coordinate.
isGlobalTrue if the position should be relative to 0, 0, 0. Default value is False.
BBDECL void BBCALL xLine3DAddNode ( x3DLine *  line3d,
float  x,
float  y,
float  z,
bool  isGlobal = false 
)

Adds a node to the end of the line.

This allows to build a polygonal chain.

Parameters:
line3d3d line handle.
xX coordinate.
yY coordinate.
zZ coordinate.
isGlobalTrue if the position should be relative to 0, 0, 0. Default value is False.
BBDECL void BBCALL xLine3DColor ( x3DLine *  line3d,
int  red,
int  green,
int  blue,
int  alpha 
)

Sets a new color and alpha of a 3d line.

Parameters:
line3d3d line handle.
redRed value of the color.
greenGreen value of the color.
blueBlue value of the color.
alphaAlpha value.
BBDECL void BBCALL xLine3DUseZBuffer ( x3DLine *  line3d,
bool  state 
)

Changes the use of Z-buffering.

If the use of Z-buffering is disabled the 3d lines will be seen through the entities ignoring the depth.

Parameters:
line3d3d line handle.
stateTrue to enable Z-buffering. False to disable Z-buffering.
BBDECL float BBCALL xLine3DOriginX ( x3DLine *  line3d,
bool  isGlobal = false 
)

Returns the starting X coordinate of a 3d line.

Parameters:
line3d3d line handle.
isGlobalTrue for global coordinates, false for local ones. Default value is false.
BBDECL float BBCALL xLine3DOriginY ( x3DLine *  line3d,
bool  isGlobal = false 
)

Returns the starting Y coordinate of a 3d line.

Parameters:
line3d3d line handle.
isGlobalTrue for global coordinates, false for local ones. Default value is false.
BBDECL float BBCALL xLine3DOriginZ ( x3DLine *  line3d,
bool  isGlobal = false 
)

Returns the starting Z coordinate of a 3d line.

Parameters:
line3d3d line handle.
isGlobalTrue for global coordinates, false for local ones. Default value is false.
BBDECL int BBCALL xLine3DNodesCount ( x3DLine *  line3d)

Returns the number of the nodes in a 3d line.

At the beginning a 3d line has 1 node.

Parameters:
line3d3d line handle.
BBDECL void BBCALL xLine3DNodePosition ( x3DLine *  line3d,
int  index,
float  x,
float  y,
float  z,
bool  isGlobal = false 
)

Sets a new position of a node.

Parameters:
line3d3d line handle.
indexIndex of a node. Should be in range [0; x3DLineNodesCount()-1]
xX coordinate.
yY coordinate.
zZ coordinate.
isGlobalTrue if the position should be relative to 0, 0, 0. Default value is False.
BBDECL float BBCALL xLine3DNodeX ( x3DLine *  line3d,
int  index,
bool  isGlobal = false 
)

Returns the X coordinate of a 3d line's node.

Parameters:
line3d3d line handle.
indexIndex of a node. Should be in range [0; x3DLineNodesCount()-1]
isGlobalTrue for global coordinates, false for local ones. Default value is false.
BBDECL float BBCALL xLine3DNodeY ( x3DLine *  line3d,
int  index,
bool  isGlobal = false 
)

Returns the Y coordinate of a 3d line's node.

Parameters:
line3d3d line handle.
indexIndex of a node. Should be in range [0; x3DLineNodesCount()-1]
isGlobalTrue for global coordinates, false for local ones. Default value is false.
BBDECL float BBCALL xLine3DNodeZ ( x3DLine *  line3d,
int  index,
bool  isGlobal = false 
)

Returns the Z coordinate of a 3d line's node.

Parameters:
line3d3d line handle.
indexIndex of a node. Should be in range [0; x3DLineNodesCount()-1]
isGlobalTrue for global coordinates, false for local ones. Default value is false.
BBDECL int BBCALL xLine3DRed ( x3DLine *  line3d)

Returns a red value of a 3d line's color.

Parameters:
line3d3d line handle.
BBDECL int BBCALL xLine3DGreen ( x3DLine *  line3d)

Returns a green value of a 3d line's color.

Parameters:
line3d3d line handle.
BBDECL int BBCALL xLine3DBlue ( x3DLine *  line3d)

Returns a blue value of a 3d line's color.

Parameters:
line3d3d line handle.
BBDECL int BBCALL xLine3DAlpha ( x3DLine *  line3d)

Returns an alpha value of a 3d line.

Parameters:
line3d3d line handle.
BBDECL int BBCALL xGetLine3DUseZBuffer ( x3DLine *  line3d)

Returns true if Z-buffering is enabled. Returns false otherwise.

If the use of Z-buffering is disabled the 3d lines will be seen through the entities ignoring the depth.

Parameters:
line3d3d line handle.
BBDECL void BBCALL xDeleteLine3DNode ( x3DLine *  line3d,
int  index 
)

Deletes a specified 3d line's node.

Parameters:
line3d3d line handle.
indexIndex of a node. Should be in range [0; x3DLineNodesCount()-1]
BBDECL void BBCALL xClearLine3D ( x3DLine *  line3d)

Deletes all the 3d line's nodes.

If you need to delete the line use xFreeEntity()

Parameters:
line3d3d line handle.