Also generating star sizes.
This commit is contained in:
parent
45fce8b464
commit
0b8c426adb
@ -3,11 +3,12 @@ import numpy as np
|
|||||||
import math
|
import math
|
||||||
import poisson
|
import poisson
|
||||||
import array
|
import array
|
||||||
|
from random import uniform
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# user defined options
|
# user defined options
|
||||||
disk = True # this parameter defines if we look for Poisson-like distribution on a disk/sphere (center at 0, radius 1) or in a square/box (0-1 on x and y)
|
disk = True # this parameter defines if we look for Poisson-like distribution on a disk/sphere (center at 0, radius 1) or in a square/box (0-1 on x and y)
|
||||||
repeatPattern = True # this parameter defines if we look for "repeating" pattern so if we should maximize distances also with pattern repetitions
|
repeatPattern = False # this parameter defines if we look for "repeating" pattern so if we should maximize distances also with pattern repetitions
|
||||||
num_points = 5 # number of points we are looking for
|
num_points = 5 # number of points we are looking for
|
||||||
num_iterations = 4 # number of iterations in which we take average minimum squared distances between points and try to maximize them
|
num_iterations = 4 # number of iterations in which we take average minimum squared distances between points and try to maximize them
|
||||||
first_point_zero = False # should be first point zero (useful if we already have such sample) or random
|
first_point_zero = False # should be first point zero (useful if we already have such sample) or random
|
||||||
@ -51,6 +52,19 @@ def main():
|
|||||||
else:
|
else:
|
||||||
print(" vec3({}, {}, {}),".format(vector[0], vector[1], vector[2]))
|
print(" vec3({}, {}, {}),".format(vector[0], vector[1], vector[2]))
|
||||||
print(");")
|
print(");")
|
||||||
|
print("")
|
||||||
|
# generate star sizes
|
||||||
|
sizes = []
|
||||||
|
for i in range(num_points):
|
||||||
|
sizes.append(uniform(0.3, 1.5))
|
||||||
|
|
||||||
|
print("float starSizes[starCount] = float[](")
|
||||||
|
for i, size in enumerate(sizes):
|
||||||
|
if (i==len(sizes)):
|
||||||
|
print(" float({})".format(size))
|
||||||
|
else:
|
||||||
|
print(" float({}),".format(size))
|
||||||
|
print(");")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
Reference in New Issue
Block a user