Skip to content

Commit

Permalink
Sube material auxiliar
Browse files Browse the repository at this point in the history
  • Loading branch information
ppizarror committed May 3, 2019
1 parent cf7ecec commit 856ef49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Binary file added aux6/auxiliar 6.pdf
Binary file not shown.
13 changes: 11 additions & 2 deletions aux6/graficador.py
Expand Up @@ -31,7 +31,7 @@ def __init__(self):
controller = Controller()

# Create camera
camera = cam.CameraR(r=3, center=Point3())
camera = cam.CameraR(r=3.5, center=Point3())
camera.set_r_vel(0.1)


Expand Down Expand Up @@ -172,6 +172,12 @@ def f(x, y, fun):
zlim = [min(vertex_grid[i][2], zlim[0]), max(vertex_grid[i][2], zlim[1])]
dz = abs(zlim[1] - zlim[0])

# Force the color
color_plot = {
'enabled': False,
'color': [1, 1, 1]
}

# Create the quads
quad_shapes = []
for i in range(nx - 1): # x
Expand All @@ -191,7 +197,10 @@ def f(x, y, fun):
# Calculate color from interpolation
zval = (pa[2] + pb[2] + pc[2] + pd[2]) / 4 # Average height of quad
zf = (zval - zlim[0]) / (dz + 0.001)
color = colorHSV(1 - zf)
if not color_plot['enabled']:
color = colorHSV(1 - zf)
else:
color = color_plot['color']

# Create the figure
quad_shapes.append(es.toGPUShape(bs_ext.create4VertexColorNormal(pa, pb, pc, pd,
Expand Down

0 comments on commit 856ef49

Please sign in to comment.