Scol standard library package  0.3.1
Common and usefull functions for all Scol applications
Functions
The library : 3d object/node API

Functions

 b3d_objDestroy (obj)
 Destroy any 3d object. More...
 
 b3d_objGetFromName (strSession, name)
 Get an 3d object from its name in a given session object. More...
 
 b3d_objGetGlobalOrientation (obj)
 Get the current global orientation of an 3d object. More...
 
 b3d_objGetOrientation (obj)
 Get the current orientation of an 3d object. More...
 
 b3d_objGetPosition (obj)
 Set the 3d object position. More...
 
 b3d_objLink (obj, father)
 Link an 3d object to another 3d object. More...
 
 b3d_objSetGlobalOrientation (obj, angDeg)
 Set the global orientation of an 3d object. More...
 
 b3d_objSetOrientation (obj, angDeg)
 Set the orientation of an 3d object. More...
 
 b3d_objSetPosition (obj, posF)
 Set the 3d object position. More...
 
 b3d_objSetRotate (obj, rot, tuple, flag)
 Rotate an 3d object. More...
 
 b3d_objSetRotatePitch (obj, pitch, flag)
 Set the pitch of an 3d object. More...
 

Detailed Description

Function Documentation

b3d_objSetPosition ( obj  ,
posF   
)

Set the 3d object position.

Prototype : fun [SO3_OBJECT [F F F]] I

Parameters
SO3_OBJECT: a 3d object
[FF F] : position
Returns
I : 0 if success, another positive value if error
  • 1 : the given object is nil
  • 2 : unable to set this new position
Examples:
3d_test/test_3d.pkg_.
b3d_objGetPosition ( obj  )

Set the 3d object position.

Prototype : fun [SO3_OBJECT] [F F F]

Parameters
SO3_OBJECT: a 3d object
Returns
[F F F] : the position if success, nil if error
b3d_objSetRotatePitch ( obj  ,
pitch  ,
flag   
)

Set the pitch of an 3d object.

Prototype : fun [SO3_OBJECT F I] I

Parameters
SO3_OBJECT: a 3d object
F: a pitch value
I: a flag, one of these following values : SO3_LOCAL_TS, SO3_PARENT_TS or SO3_WORLD_TS
Returns
I : 0 if success, another positive value if error
  • 1 : given 3d object is nil
  • 2 : unable to perform this operation
Examples:
3d_test/test_3d.pkg_.
b3d_objSetRotate ( obj  ,
rot  ,
tuple  ,
flag   
)

Rotate an 3d object.

Prototype : fun [SO3_OBJECT F [F F F] I] I

Parameters
SO3_OBJECT: a 3d object
F: a rotation value
[FF F] : vector (values by axes)
I: a flag, one of these following values : SO3_LOCAL_TS, SO3_PARENT_TS or SO3_WORLD_TS
Returns
I : 0 if success, another positive value if error
  • 1 : given 3d object is nil
  • 2 : unable to perform this operation
Examples:
3d_test/test_3d.pkg_.
b3d_objLink ( obj  ,
father   
)

Link an 3d object to another 3d object.

Prototype : fun [SO3_OBJECT SO3_OBJECT] I

Parameters
SO3_OBJECT: a 3d object (child)
SO3_OBJECT: another 3d object (father)
Returns
I : 0 if success, another positive value if error
  • 1 : one of given 3d objects is nil
  • 2 : unable to link the child object to the father object
b3d_objSetOrientation ( obj  ,
angDeg   
)

Set the orientation of an 3d object.

Prototype : fun [SO3_OBJECT [F F F]] I

Parameters
SO3_OBJECT: a 3d object (child)
[FF F] : new angle, in degree. If nil, the vector will be [0.0 0.0 0.0].
Returns
I : 0 if success, another positive value if error
  • 1 : the 3d objects is nil.
  • 2 : unable to set this change.
b3d_objSetGlobalOrientation ( obj  ,
angDeg   
)

Set the global orientation of an 3d object.

Prototype : fun [SO3_OBJECT [F F F]] I

Parameters
SO3_OBJECT: a 3d object (child)
[FF F] : new angle, in degree. If nil, the vector will be [0.0 0.0 0.0].
Returns
I : 0 if success, another positive value if error
  • 1 : the 3d objects is nil.
  • 2 : unable to set this change.
b3d_objGetOrientation ( obj  )

Get the current orientation of an 3d object.

Prototype : fun [SO3_OBJECT] [F F F]

Parameters
SO3_OBJECT: a 3d object (child)
Returns
[F F F] : this orientation in degree if success or nil if error
b3d_objGetGlobalOrientation ( obj  )

Get the current global orientation of an 3d object.

Prototype : fun [SO3_OBJECT] [F F F]

Parameters
SO3_OBJECT: a 3d object (child)
Returns
[F F F] : this orientation in degree if success or nil if error
b3d_objGetFromName ( strSession  ,
name   
)

Get an 3d object from its name in a given session object.

Prototype : fun [LIB3D_Session S] SO3_OBJECT

Parameters
LIB3D_Session: a 3d session object
S: a name
Returns
SO3_OBJECT : this object if success or nil if error or not found
b3d_objDestroy ( obj  )

Destroy any 3d object.

Prototype : fun [SO3_OBJECT] I

Parameters
SO3_OBJECT: a 3d object to destroy
Returns
I : 0 if success or a positive value if error :
  • 1 : 3d object is nil
  • 2 : unable to destroy this object