Skip to content

Commit

Permalink
чуть чуть суеты
Browse files Browse the repository at this point in the history
  • Loading branch information
yFFinS committed Jun 2, 2022
1 parent 106b800 commit 071f4ab
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
29 changes: 23 additions & 6 deletions gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,39 @@ def action_rect(self):
self.__gl_scene().create_rect()

def action_stress_test2(self):
def set1(u, v):
x = glm.sinh(u) * glm.cosh(v)
y = glm.sinh(v)
z = glm.cosh(u) * glm.cosh(v)
return glm.vec3(x, y, z)

def set2(u, v):
x = u
y = v
z = glm.sin(2 * (x + y * y * y))
return glm.vec3(x, y, z)

def set3(u, v):
x = u
y = v
z = (1 - x * x / 100 - y * y / 100) ** 0.5
return glm.vec3(x, y, z.real)

scene = self.__gl_scene().get_scene()
bounds = 4
step = 0.05
bounds = 10
step = 0.2
max_buffer_size = 10_000

func = random.choice([set1, set2, set3])

prev = None
objects = []
u = -bounds
while u < bounds:
v = -bounds
while v < bounds:
v += step
x = glm.sinh(u) * glm.cosh(v)
y = glm.sinh(v)
z = glm.cosh(u) * glm.cosh(v)
pos = glm.vec3(x, y, z)
pos = func(u, v)
point = ScenePoint.by_pos(pos)
objects.append(point)

Expand Down
8 changes: 4 additions & 4 deletions scene/render_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@ class SceneCoordAxis(RawSceneObject):
X_COLOR = glm.vec4(1, 0, 0, 1)
Y_COLOR = glm.vec4(0, 1, 0, 1)
Z_COLOR = glm.vec4(0, 0, 1, 1)
NEG_COLOR_FACTOR = 150
NEG_X_COLOR = glm.vec4(1, NEG_COLOR_FACTOR / 256, NEG_COLOR_FACTOR / 256, 1)
NEG_Y_COLOR = glm.vec4(NEG_COLOR_FACTOR / 256, 1, NEG_COLOR_FACTOR / 256, 1)
NEG_Z_COLOR = glm.vec4(NEG_COLOR_FACTOR / 256, NEG_COLOR_FACTOR / 256, 1, 1)
NEG_COLOR_FACTOR = 150 / 256
NEG_X_COLOR = glm.vec4(1, NEG_COLOR_FACTOR, NEG_COLOR_FACTOR, 1)
NEG_Y_COLOR = glm.vec4(NEG_COLOR_FACTOR, 1, NEG_COLOR_FACTOR, 1)
NEG_Z_COLOR = glm.vec4(NEG_COLOR_FACTOR, NEG_COLOR_FACTOR, 1, 1)

def __init__(self):
super(SceneCoordAxis, self).__init__()
Expand Down

0 comments on commit 071f4ab

Please sign in to comment.