I think the problem is in 3d script

"compute transform":

EPS = 0.001

dirX = coro_targetX - coro_posX

dirY = coro_targetY - coro_posY

dirZ = coro_targetZ - coro_posZ

dirLen = SQR(dirX**2 + dirY**2 + dirZ**2)

if ABS(dirZ) > EPS then

rotationY = ATN(SQR(dirX**2 + dirY**2)/dirZ)

if dirZ < 0 then rotationY = 180 + rotationY

else

rotationY = 90

endif

if ABS(dirX) > EPS then

rotationZ = ATN(dirY / dirX)

if dirX < 0 then rotationZ = 180 + rotationZ

else

if dirY > 0 then

rotationZ = 90

else

rotationZ = -90

endif

endif

2d script can be usefull:

HOTSPOT2 0, coro_targetY, unID, coro_targetX, 1+128 : unID = unID+1

HOTSPOT2 -1, coro_targetY, unID, coro_targetX, 3 : unID = unID+1

HOTSPOT2 coro_targetX, coro_targetY, unID, coro_targetX, 2 : unID = unID+1

HOTSPOT2 coro_targetX, 0, unID, coro_targetY, 1+128 : unID = unID+1

HOTSPOT2 coro_targetX, -1, unID, coro_targetY, 3 : unID = unID+1

HOTSPOT2 coro_targetX, coro_targetY, unID, coro_targetY, 2 : unID = unID+1

Peter

« *Last Edit: 2020-01-30, 14:28:27 by rozky* »

Logged

Archicad 8-23CZE, Corona Renderer for Archicad Alpha 5