fabiencasenave commited on
Commit
7d9d915
·
verified ·
1 Parent(s): 6336116

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -44,7 +44,7 @@ def sample_info(sample_id_str, fieldn):
44
  # generate colormap
45
  if np.linalg.norm(field) > 0:
46
  norm = mpl.colors.Normalize(vmin=np.min(field), vmax=np.max(field))
47
- cmap = cm.coolwarm
48
  m = cm.ScalarMappable(norm=norm, cmap=cmap)
49
 
50
  vertex_colors = m.to_rgba(field)[:,:3]
@@ -61,16 +61,16 @@ def sample_info(sample_id_str, fieldn):
61
 
62
  # compose scene
63
  scene = pyrender.Scene(ambient_light=[.1, .1, .3], bg_color=[0, 0, 0])
64
- camera = pyrender.PerspectiveCamera( yfov=np.pi / 3.0)
65
  light = pyrender.DirectionalLight(color=[1,1,1], intensity=1000.)
66
 
67
  scene.add(mesh, pose= np.eye(4))
68
  scene.add(light, pose= np.eye(4))
69
 
70
- scene.add(camera, pose=[[ 1, 0, 0, 0.08],
71
- [ 0, 1, 0, 0.21],
72
- [ 0, 0, 1, 0.12],
73
- [ 0, 0, 0, 1]])
74
 
75
  # render scene
76
  r = pyrender.OffscreenRenderer(1024, 1024)
 
44
  # generate colormap
45
  if np.linalg.norm(field) > 0:
46
  norm = mpl.colors.Normalize(vmin=np.min(field), vmax=np.max(field))
47
+ cmap = cm.nipy_spectral#cm.coolwarm
48
  m = cm.ScalarMappable(norm=norm, cmap=cmap)
49
 
50
  vertex_colors = m.to_rgba(field)[:,:3]
 
61
 
62
  # compose scene
63
  scene = pyrender.Scene(ambient_light=[.1, .1, .3], bg_color=[0, 0, 0])
64
+ camera = pyrender.PerspectiveCamera( yfov=np.pi / 6.0)
65
  light = pyrender.DirectionalLight(color=[1,1,1], intensity=1000.)
66
 
67
  scene.add(mesh, pose= np.eye(4))
68
  scene.add(light, pose= np.eye(4))
69
 
70
+ scene.add(camera, pose=[[ 1, 0, 0, 0.02],
71
+ [ 0, 1, 0, 0.21],
72
+ [ 0, 0, 1, 0.19],
73
+ [ 0, 0, 0, 1]])
74
 
75
  # render scene
76
  r = pyrender.OffscreenRenderer(1024, 1024)