python - add ambient light to vispy scene -
i trying add ambient light vispy mesh. here code using render triangulated mesh.
meshdata = vispy.geometry.meshdata(vertices=r.vertices, faces=r.faces, vertex_colors=r.vcolor) canvas = scene.scenecanvas(keys='interactive', size=(800, 600), show=true) mesh = scene.visuals.mesh(meshdata=meshdata, shading='smooth') view = canvas.central_widget.add_view() view.add(mesh) view.bgcolor = '#efefef' view.camera = turntablecamera(azimuth=azimuth, elevation=elevation) color = color("#3f51b5") axis = scene.visuals.xyzaxis(parent=view.scene) if __name__ == '__main__' , sys.flags.interactive == 0: canvas.app.run()
somehow mesh appears dark , want add ambient lights this. how can this? searched online , seems not easy. want start using python 3 , trying use vispy instead of mayavi. appreciated.
Comments
Post a Comment