mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 13:24:02 +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 math import sqrt, hypot, atan2, pi, fmod, degrees
|
||||||
from sys import argv,stderr
|
from sys import argv,stderr
|
||||||
|
|
||||||
n = 10
|
|
||||||
|
|
||||||
|
n = 10
|
||||||
if len(argv) > 1:
|
if len(argv) > 1:
|
||||||
n = int(argv[1])
|
n = int(argv[1])
|
||||||
|
|
||||||
|
hemisphere=False
|
||||||
|
|
||||||
bars_total, bars_prev = 77, 0
|
bars_total, bars_prev = 77, 0
|
||||||
|
|
||||||
for i in range(n):
|
for i in range(n):
|
||||||
|
@ -27,6 +29,8 @@ for i in range(n):
|
||||||
b = max(0,min(255,w + randint(-10,100)))
|
b = max(0,min(255,w + randint(-10,100)))
|
||||||
# position
|
# position
|
||||||
x,y,z = random()*2-1,random(),random()*2-1
|
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)
|
l = sqrt(x*x + y*y + z*z)
|
||||||
x /= l; y /= l; z /= l
|
x /= l; y /= l; z /= l
|
||||||
xz = hypot(x,z)
|
xz = hypot(x,z)
|
||||||
|
|
Loading…
Reference in a new issue