Re: [nbos] [A3] Rotating.
NBOS Support
Mon Feb 6th, 2012

This one works better.... the other one wasnt using the right x value in
the calculation for o.z.


#plugin Rotate Sector
#author NBOS
#desc Rotates sector selected degrees

a = 45 * (3.14159 / 180) 'angle in degrees converted to radians

sector = GetCurrentSector()
j = sector.SystemCount
For i = 1 to j
o = sector.GetSystem( i-1)

x = o.x
y = o.y
z = o.z

o.x = (Cos( a) * x) - (Sin( a) * z)
o.z = (Sin( a) * x) + (Cos( a) * z)

o.Modified = true

If i mod 100 = 0 Then
sector.RenderMessageBig = "Updating " & i & " of " & j
RefreshScene
End If

Next
sector.RenderMessageBig = ""
RefreshScene


_______________________________________________
Nbossoftware mailing list


Copyright © 2003-2007, NBOS Software. All rights reserved. 'Fractal Mapper', 'ScreenMonkey', 'Character Sketcher', 'Inspiration Pad', 'Fractal World Explorer', 'Goblin API', 'AstroSynthesis' are trademarks of NBOS Software. 'Dwarven Beserker' art by V. Shane.
Member contributed resources