forked from DLR-RM/BlenderProc
-
Notifications
You must be signed in to change notification settings - Fork 0
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 DLR-RM#474 from DLR-RM/iss_427_add_quickstart
Fix(quickstart.py): Actually add the script
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import blenderproc as bproc | ||
import numpy as np | ||
|
||
bproc.init() | ||
|
||
# Create a simple object: | ||
obj = bproc.object.create_primitive("MONKEY") | ||
|
||
# Create a point light next to it | ||
light = bproc.types.Light() | ||
light.set_location([2, -2, 0]) | ||
light.set_energy(300) | ||
|
||
# Set the camera to be in front of the object | ||
cam_pose = bproc.math.build_transformation_mat([0, -5, 0], [np.pi / 2, 0, 0]) | ||
bproc.camera.add_camera_pose(cam_pose) | ||
|
||
# Render the scene | ||
data = bproc.renderer.render() | ||
|
||
# Write the rendering into an hdf5 file | ||
bproc.writer.write_hdf5("output/", data) |