Page 1 of 1

How to create a ("Beacon") circle beam

Posted: Tue Nov 20, 2012 4:45 am
by Tuck
Credits for this snippit goes to freddukes.

Method to achieve points in a circle:

Syntax: Select all

def get_points(radius, origin, steps = 12, horizontal = True):
points = []
increment = 2 * pi / steps
for index in range(steps):
theta = increment * index
x_offset = cos(theta) * radius + origin.x
if horizontal:
y_offset = sin(theta) * radius + origin.y
z_offset = origin.z
else:
y_offset = origin.y
z_offset = sin(theta) * radius + origin.z
points.append((x_offset, y_offset, z_offset))
return points


Syntax: Select all

points = get_points(radius, origin) #radius how big should the circle be around Origin
for x, y in enumerate(points):
start_point = y
end_index = x + 1
if end_index == len(points):
end_index = 0
end_point = points[end_index]
effects.Beam(Shared.Vector(*start_point), Shared.Vector(*end_point),
model, model, frameStart, frameRate, time, width,
endWidth, fadeLength, noise, red, green, blue, alpha, speed)