-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from zincware/SamTov_mitsuba_rendering
Mitsuba rendering option
- Loading branch information
Showing
16 changed files
with
354 additions
and
30 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
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,69 @@ | ||
""" | ||
ZnVis: A Zincwarecode package. | ||
License | ||
------- | ||
This program and the accompanying materials are made available under the terms | ||
of the Eclipse Public License v2.0 which accompanies this distribution, and is | ||
available at https://www.eclipse.org/legal/epl-v20.html | ||
SPDX-License-Identifier: EPL-2.0 | ||
Copyright Contributors to the Zincwarecode Project. | ||
Contact Information | ||
------------------- | ||
email: [email protected] | ||
github: https://github.com/zincware | ||
web: https://zincwarecode.com/ | ||
Citation | ||
-------- | ||
If you use this module please cite us with: | ||
Summary | ||
------- | ||
Tutorial script to visualize simple spheres over a random trajectory. | ||
""" | ||
|
||
import mitsuba as mi | ||
import numpy as np | ||
|
||
import znvis as vis | ||
|
||
if __name__ == "__main__": | ||
""" | ||
Run the simple spheres example. | ||
""" | ||
# Particle 1 definition | ||
hairy = mi.load_dict({"type": "conductor", "material": "Au"}) | ||
material_1 = vis.Material( | ||
colour=np.array([30, 144, 255]) / 255, alpha=0.6, mitsuba_bsdf=hairy | ||
) | ||
|
||
# Define the first particle. | ||
trajectory = np.random.uniform(-100, 100, (100, 1000, 3)) | ||
mesh = vis.Sphere(radius=2.0, resolution=10, material=material_1) | ||
particle = vis.Particle( | ||
name="Blue", mesh=mesh, position=trajectory, smoothing=False | ||
) | ||
|
||
# Define the second particle. | ||
bsdf_smooth_plastic = mi.load_dict( | ||
{ | ||
"type": "plastic", | ||
"diffuse_reflectance": {"type": "rgb", "value": [0.1, 0.27, 0.36]}, | ||
"int_ior": 1.9, | ||
} | ||
) | ||
material_2 = vis.Material( | ||
colour=np.array([255, 140, 0]) / 255, | ||
alpha=1.0, | ||
mitsuba_bsdf=bsdf_smooth_plastic, | ||
) | ||
|
||
# Define the second particle. | ||
trajectory_2 = np.random.uniform(-10, 10, (100, 1000, 3)) | ||
mesh_2 = vis.Sphere(radius=1.0, resolution=10, material=material_2) | ||
particle_2 = vis.Particle( | ||
name="Orange", mesh=mesh_2, position=trajectory_2, smoothing=False | ||
) | ||
|
||
# Construct the visualizer and run | ||
visualizer = vis.Visualizer(particles=[particle, particle_2], frame_rate=20) | ||
visualizer.run_visualization() |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ numpy | |
pytest | ||
rich | ||
opencv-python | ||
mitsuba |
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,26 @@ | ||
""" | ||
ZnVis: A Zincwarecode package. | ||
License | ||
------- | ||
This program and the accompanying materials are made available under the terms | ||
of the Eclipse Public License v2.0 which accompanies this distribution, and is | ||
available at https://www.eclipse.org/legal/epl-v20.html | ||
SPDX-License-Identifier: EPL-2.0 | ||
Copyright Contributors to the Zincwarecode Project. | ||
Contact Information | ||
------------------- | ||
email: [email protected] | ||
github: https://github.com/zincware | ||
web: https://zincwarecode.com/ | ||
Citation | ||
-------- | ||
If you use this module please cite us with: | ||
Summary | ||
------- | ||
Init file for the rendering module. | ||
""" | ||
|
||
from znvis.rendering.mitsuba import Mitsuba | ||
|
||
__all__ = [Mitsuba.__name__] |
Oops, something went wrong.