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:
I am able to rotate the camshaft with this script:
I searched the forums and found nothing on that particular subject.
Regards
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:
I am able to rotate the camshaft with this script:
Code:
--[[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:setLength(10)
ani:setEvent('start', 'motorStart')
ani:setEvent('frame', 'motorFrame')
end
function motorStart()
mainSf=ldc.subfile()
end
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)
ax1:setOri(ori)
end
register()
I searched the forums and found nothing on that particular subject.
Regards