mirror of
https://github.com/lubosz/overte.git
synced 2025-04-26 08:55:38 +02:00
changes default to generate a full sphere
This commit is contained in:
parent
24d0f3a0a0
commit
eac8c99ee1
1 changed files with 5 additions and 1 deletions
|
@ -12,11 +12,13 @@ from random import random,randint
|
|||
from math import sqrt, hypot, atan2, pi, fmod, degrees
|
||||
from sys import argv,stderr
|
||||
|
||||
n = 10
|
||||
|
||||
n = 10
|
||||
if len(argv) > 1:
|
||||
n = int(argv[1])
|
||||
|
||||
hemisphere=False
|
||||
|
||||
bars_total, bars_prev = 77, 0
|
||||
|
||||
for i in range(n):
|
||||
|
@ -27,6 +29,8 @@ for i in range(n):
|
|||
b = max(0,min(255,w + randint(-10,100)))
|
||||
# position
|
||||
x,y,z = random()*2-1,random(),random()*2-1
|
||||
if not hemisphere:
|
||||
y = y*2-1
|
||||
l = sqrt(x*x + y*y + z*z)
|
||||
x /= l; y /= l; z /= l
|
||||
xz = hypot(x,z)
|
||||
|
|
Loading…
Reference in a new issue