🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!
function octagon takes real StartX, real StartY, real Length returns nothing
local integer i = 0
loop
exitwhen i > 7
set Location[i] = Location(StartX + Length * Cos((360/8)*i),StartY + Length * Sin((360/8)*i))
set i = i + 1
endloop
endfunction
Yes it sets the points,
Create a variable with a name and type Pointarray
in the Custom script, change 'udg_Location[bj_forLoopIndexA]' with 'udg_YOURNAME[bj_forLoopIndexA]'
udg_Location[0] is the most right point, Location[2] is the lowest point, Location[4] is the most left point, and Location[6] is the upper point, the rest is in between,, so this is how you can see it:
Location[0] = East
Location[1] = SouthEast
Location[2] = South
Location[3] = SouthWest
Location[4] = West
Location[5] = NorthWest
Location[6] = North
Location[7] = NorthEast
If you want any polygon just use 360 : (Number of the polygons side), It is very simple, You want octagon, 360 : 8 = 45
If you Want the eight points just set
Octagon[1] = 45
Octagon[2] = 90
Octagon[3] = 135
Octagon.... = ....
Octagon is a variable real array
Wow, great, then you have the angle at which every point is. If you look very well you can see that in my function, you dont calculate the angles, but the Locations already, so no need of that real array, only a point array,,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.