Smoothly rotating to another angle on pano nodes
Status: Alpha
Brought to you by:
cwalther
From: James C. W. <jfc...@ya...> - 2009-12-10 06:25:51
|
Hi all, I've been working on a library for cubic panorama rotation, and have run into a problem. When I run this code, Pipmak will smoothly rotate to either 90, 90, or 90, -90(disregarding panorama limits), and slowly spins. I can tell there's something wrong with this code, but I don't know what it is exactly, or how to fix it. Can anyone suggest a possible solution? Thanks very much, if anyone can. CODE********************************************** cubic { "front.jpg", "right.jpg", "back.jpg", "left.jpg", "top.jpg", "bottom.jpg" } local tarAZ, tarEL = 45, 45 local viewAZ, viewEL = pipmak.getviewdirection() local speedAZ, speedEL if viewAZ > tarAZ then speedAZ = viewAZ / tarAZ elseif viewAZ < tarAZ then speedAZ = tarAZ / viewAZ end if viewEL > tarEL then speedEL = viewEL / tarEL elseif viewEL < tarEL then speedEL = tarEL / viewEL end hotspotmap "hotspotmap.png" hotspot { onmousedown = function() pipmak.schedule( 0.02, function() viewAZ, viewEL = pipmak.getviewdirection() if viewAZ == tarAZ and viewEL == tarEL then viewAZ, viewEL = tarAZ, tarEL else pipmak.setviewdirection( viewAZ + 0.8, viewEL * speedEL + 0.8 ) end return 0.02 end ) end } END CODE ************************************* Thanks again, James |