-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
57 changed files
with
1,027 additions
and
502 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Make the silhouette of an object | ||
move along with camera position. | ||
""" | ||
from vtkplotter import * | ||
import vtk | ||
|
||
plt = Plotter(bg='lightblue', interactive=False) | ||
|
||
s = load(datadir+'shark.ply') | ||
s.alpha(0.1).c('gray').lw(0.1).lc('red') | ||
plt.show(s, Text(__doc__)) | ||
|
||
sil = vtk.vtkPolyDataSilhouette() | ||
sil.SetInputData(s.polydata()) | ||
sil.SetCamera(plt.camera) | ||
silMapper = vtk.vtkPolyDataMapper() | ||
silMapper.SetInputConnection(sil.GetOutputPort()) | ||
|
||
actor = Actor() | ||
actor.lw(4).c('black').SetMapper(silMapper) | ||
|
||
plt.add(actor) # add() also renders the scene | ||
interactive() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
This example shows how to animate simultaneously various objects | ||
by specifying event times and durations of the effects | ||
""" | ||
from vtkplotter import * | ||
|
||
sp = Sphere(r=0.5).cutWithPlane(origin=(0.15,0,0)).lw(0.1) | ||
cu = Cube().pos(-2,0,0) | ||
tr = Torus().pos(1,0,0).rotateY(80) | ||
|
||
vp = Animation() | ||
vp.showProgressBar = True | ||
vp.timeResolution = 0.025 # secs | ||
|
||
vp.fadeIn([cu, tr], t=0, duration=0.2) | ||
vp.fadeIn(sp, t=1, duration=2) | ||
|
||
vp.move(sp, (2,0,0), style="linear") | ||
vp.rotate(sp, axis="y", angle=180) | ||
|
||
vp.fadeOut(sp, t=3, duration=2) | ||
vp.fadeOut(tr, t=4, duration=1) | ||
|
||
vp.scale(cu, 0.1, t=5, duration=1) | ||
|
||
vp.totalDuration = 4 # can shrink/expand total duration | ||
|
||
vp.play() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
This example shows how to animate simultaneously various objects | ||
by specifying event times and durations of the visual effects. | ||
""" | ||
from vtkplotter import * | ||
|
||
s = load(datadir+"bunny.obj").subdivide().normalize() | ||
|
||
vp = Animation() | ||
vp.timeResolution = 0.02 # secs | ||
|
||
vp.switchOn(s) | ||
|
||
# no need to repeat t=1, duration=3 in changeLighting and changeColor | ||
vp.meshErode(corner=0, t=1, duration=3).changeLighting("glossy").changeColor("v") | ||
|
||
cam1 = orientedCamera(backoffVector=(0, 0, -1), backoff=8) | ||
cam2 = orientedCamera(backoffVector=(1, 1, 1), backoff=8) | ||
vp.moveCamera(cam1, cam2, t=0, duration=4) | ||
|
||
vp.play() |
Oops, something went wrong.