permanently rotate an object

Post » Mon Feb 01, 2016 9:32 am

For this https://imgur.com/a/JiYOK I would like to have a script on those spheres that lets them rotate constantly. It should be really slow and never stop. Could someone help me with that? It should rotate around the Z axis ... or is a combination of Z and Y axis possible?

I am aware of the rotate command and tried using it but whatever I do in scripting never turns out the way I intended it, while I know you guys make such script in five minutes and it works.

Thanks!
User avatar
Farrah Barry
 
Posts: 3523
Joined: Mon Dec 04, 2006 4:00 pm

Post » Sun Jan 31, 2016 5:49 pm

Should be as simple as (for 15 degrees per sec):



begin rot_scri
rotate z 15
rotate y 15
end
User avatar
Sara Johanna Scenariste
 
Posts: 3381
Joined: Tue Mar 13, 2007 8:24 pm

Post » Mon Feb 01, 2016 6:46 am

I simply made one of float scripts to just rotate. Although pivot should be changed properly in the mesh.



begin floatAboveVt
float timer
float swingTime
float startAngle
float startAngle2
float currangle
float currangle2
float xvalue
short reset
short initialized
if ( initialized == 0 )

set startAngle to GetAngle, X
set startAngle2 to GetAngle, Y
set swingTime to 1
set initialized to 1
endif
if ( MenuMode == 0 )
if ( timer == 0 )
if ( reset == 0 )
set timer to Random 100
set timer to timer / 4
endif
endif

set timer to ( timer + GetSecondsPassed )
set currangle to GetAngle X
set currangle2 to GetAngle Y

;These set the amount to move or rotate depending on framerate:
set xvalue to 10 * GetSecondsPassed

; the crate sways around its x axis:

set currangle to currangle + xvalue
set currangle2 to currangle2 + xvalue
SetAngle X currangle
SetAngle Y currangle2

endif
end
User avatar
Richard
 
Posts: 3371
Joined: Sat Oct 13, 2007 2:50 pm

Post » Mon Feb 01, 2016 1:19 am

Thank you very much guys! I think I can use them both.
User avatar
Sammygirl500
 
Posts: 3511
Joined: Wed Jun 14, 2006 4:46 pm


Return to III - Morrowind