My Account


RSS
oZone3D.Net RSS Feeds»RSS 2.0 Feeds

Blogs
»Demoniak3D Blog
»JeGX's Infamous Lab

Sponsors

Modul8: real time video mixing and compositing


Link to Us

oZone3D.Net 100% Realtime 3D

»All Links

Web Partners

www.geeks3d.com
www.benchmarkhq.ru
www.tdt3d.com
www.steph3d.net
www.g-truc.net
www.worldpcspecs.com


Banners Exchange

www.jmax-hardware.com
cgindia.blogspot.com
grapejuice.c.la
www.game-lab.com


Links Exchange

»CYGAD's 3DXtra

Search
Google
Web
oZone3D.Net
 
oZone3D.Net - Demoniak3D Developer Guide


» Back To Index

Demoniak3D/LUA API: Motion-paths Management library

The HYP_MotionPath library performs general operations on motion-paths.
HYP_MotionPath.GetValueByTime
HYP_MotionPath.GetObjectCurrentTime
HYP_MotionPath.Attach

Attach

Attach allows to attach a motion-path to an object (model, mesh, light, gizmo, camera).
Syntax
HYP_MotionPath.Attach( object_name, motion_path_name, time_offset, time_step );
  • object_name - [STR127] - name of the object to which you wish to attach a motion-path.
  • motion_path_name - [STR127] - name of the motion path.
  • time_offset - [CLAMPED_REAL] - initial value of the time offset. Put 0.0 to start at the beginning of the motion-path (1.0 corresponds to the end of the motion-path).
  • time_step - [CLAMPED_REAL] - value of the increment along the motion-path. With each frame, the object moves time_step on motion-path.
Example
-- test de HYP_SetMotionPath.
HYP_MotionPath.Attach( "light01", "main_motion_path", 0.0, 0.0001 );
Remark
To detach a motion-path from an object, just replace the name of the motion-path by the "NULL" character string
HYP_SetMotionPath( "light01", "NULL", 0.0 );

GetValueByTime

GetValueByTime makes it possible to get the 3d position of a point on the motion-path for a "t" standardized time (ranging between 0.0 and 1.0).

This function is useful because it is not necessary to attach a motion-path to an object so that it moves along the motion-path. This can apply to any object whose position can be changed (via LUA), just by declaring a motion_path node in the XML script.
Syntax
x, y, z = HYP_MotionPath.GetValueByTime( motion_path_name, time );
  • motion_path_name - [STR127] - name of the motion path.
  • time - [CLAMPED_REAL] - time value. 0.0 is the beginning of the motion-path and 1.0 is the end.
  • x - [REAL] - X coordinate of the position
  • y - [REAL] - Y coordinate of the position
  • z - [REAL] - Z coordinate of the position
Example
time = 0.26;
x, y, z = HYP_MotionPath.GetValueByTime( "main_motion_path", time );

GetObjectCurrentTime

GetObjectCurrentTime makes it possible to get the temporal current position of an object on a motion-path. This function is useful to know for example the end of the trajectory when a motion path has been attached with the object.
Syntax
time = HYP_MotionPath.GetObjectCurrentTime( object_name );
  • object_name - [STR127] - name of the object.
  • time - [CLAMPED_REAL] - time value. 0.0 is the beginning of the motion-path and 1.0 is the end.




Language:


Demoniak3D
Current Version: 1.23.0
»Demoniak3D
»Download
»Libraries and Plugins
»Demos
»Online Help - Reference Guide
»Codes Samples


GPU Caps Viewer
Current Version: 1.4.2
»GPU Caps Viewer
»GPU DB Submissions


FurMark
Current Version: 1.4.0
»FurMark
»Benchmark Submissions


Geeks3D News
Page generated in 0.073093891143799 seconds.