Motor animation

Motor animation
Hi everyone,
I am wondering how is it possible to animate motor in LDCad?
I found great LDCAD animation on youtube :

I found Scripting API on Melkert website 

Here the model:
[Image: Motor_animation_view.png]

I am able to rotate the camshaft with this script:

--[[Sripted by Co for NEMOOZ]]
function register()

-- "Dissolve" script makes parts disappear progressively from the model ("Build" inverse)
    local ani=ldc.animation('Motor')

   --Set the length of the animation in seconds
   ani:setEvent('start', 'motorStart')
   ani:setEvent('frame', 'motorFrame')

function motorStart()

function motorFrame()

   local ani=ldc.animation.getCurrent()
   local ori=ldc.matrix()
   local angle=1800*ani:getFrameTime()/ani:getLength()
   local ax1=mainSf:getRef('axe_motor.ldr')
   ori:setRotate(angle, 1, 0, 0)


I searched the forums and found nothing on that particular subject.


Attached Files
.zip (Size: 921.15 KB / Downloads: 9)
« Next Oldest | Next Newest »

Messages In This Thread
Motor animation - by NEMOOZ - 2018-07-29, 19:04
RE: Motor animation - by Roland Melkert - 2018-07-31, 11:22
RE: Motor animation - by NEMOOZ - 2018-08-07, 18:33
RE: Motor animation - by Roland Melkert - 2018-08-07, 18:49
RE: Motor animation - by NEMOOZ - 2018-09-02, 13:56
RE: Motor animation - by Roland Melkert - 2018-09-02, 19:10

Forum Jump:

Users browsing this thread: 1 Guest(s)