No description, website, or topics provided.
Python Ruby GLSL
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc chair render figure Apr 14, 2014
shaders simplified layout Apr 4, 2014
.gitignore Initial commit Apr 2, 2014
LICENSE
README.md Added export dae script Apr 8, 2015
check_normals.py made runnable scripts executable Apr 11, 2014
compress.py
dae_to_ply.py
dae_to_wrl.py made runnable scripts executable Apr 11, 2014
decompress.py
export_dae.rb fixed typo Apr 8, 2015
get_camera_matrices.py clean up get_camera_matrices script Apr 12, 2014
model.py simplified layout Apr 4, 2014
render.py
scrape_collection.py added some readme Apr 14, 2014
scrape_similar.py made runnable scripts executable Apr 11, 2014
todo.txt
util.py forgot to add util Apr 4, 2014

README.md

seeing3d

Dependencies

Rendering models

The main script to render your models into 2D images is render.py. The usage syntax is:

render.py [-h] [--mode {rgb,depth,normals}] [--win-size WIN_SIZE]
                 [--focal-length-in FOCAL_LENGTH_IN] [--rho-in RHO_IN]
                 [--phi-deg PHI_DEG] [--theta-delta-deg THETA_DELTA_DEG]
                 [--mkdir] [--clear-cache] [--wrl]
                 MODEL_DIR OUTPUT_DIR

Render 3D models to images

positional arguments:
  MODEL_DIR             Base path of model
  OUTPUT_DIR            Model id/directory

optional arguments:
  -h, --help            show this help message and exit
  --mode {rgb,depth,normals}
  --win-size WIN_SIZE   output window size
  --focal-length-in FOCAL_LENGTH_IN
  --rho-in RHO_IN       rho (distance from camera) in inches
  --phi-deg PHI_DEG     phi/pitch in degrees
  --theta-delta-deg THETA_DELTA_DEG
                        theta/yaw increments in degrees
  --mkdir
  --clear-cache
  --wrl                 Use .wrl model. Note: this has no texture

For example,

~/render.py ~/chairs/1028b32dc1873c2afe26a3ac360dbd4 ~/tmp_renders

would use the default parameters to render 64 RGB views of the model in directory ~/chairs/1028b32dc1873c2afe26a3ac360dbd4 as a sequence of files in tmp_renders. Note that you will see an empty window pop up, which is a side-effect of the rendering process.

For a visualization of the phi, theta and rho parameters see the following figure:

Camera and model

How does rendering work?

Conceptually, we set up the scene (including camera, model and lighting), render the output into a buffer, and save this buffer into a .png file. In practice, this involves setting various obscure options in Panda and extreme care in the format of the Collada model. Unfortunately, libraries to load 3D models tend to not be very robust.

You are encouraged to examine and improve the code.

How to get DAE from SKP? (Added April 8 2015)

If you download the SKP files from warehouse you can't use them directly with this software. You can convert models manually with sketchup's export feature. This obviously doesn't scale well for many models. I wrote a script (export_dae.rb) to export them using the ruby API, which I haven't put here before because it's basically a quick hack and I don't know ruby. However, you may still find it useful.

TODO

  • Warehouse 3D markup changed, breaking scraper.