Table Of Contents

Previous topic

Surface Models

Next topic

Simulating Optical Photons

This Page

Rendering Tools

There are three different ways to render a geometry: you can explicitly create a Camera instance, call the function view(), or use the script chroma-cam.

Example:
>>> chroma.view(chroma.make.cube())
_images/cube.png

To control the camera refer to the following table and Camera Hotkeys.

Thing You Do Modifier Thing That Happens
click and drag   rotate camera around object
click and drag shift translate camera
click and drag control rotate camera
mouse wheel   zoom

Camera Hotkeys

Command Thing That Happens
alt toggle fine motion
F11 toggle fullscreen
escape quit
= increase the alpha depth by one
- decrease the alpha depth by one
pagedown move down through the bounding volume hierarchy tree
pageup move up through the bounding volume hierarchy tree
3 toggle 3d mode
g toggle 3d colors between red/cyan and green/magenta
F12 take a screenshot
m make a movie
F5 [1] toggle hybrid monte carlo rendering mode
F6 [2] place a light source at the camera’s current location
F7 [2] add another light source at the camera’s current location

Footnotes

[1]The hybrid monte carlo rendering mode requires the geometry have surfaces with a non-zero diffuse reflection probability.
[2](1, 2) Only available in hybrid monte carlo rendering mode.

The Camera Class

class chroma.Camera(geometry, size=(800, 600), device_id=None)

The Camera class uses pygame to render a geometry. Camera objects inherit from multiprocessing.Process so that you can render multiple geometries in separate windows at the same time.

start()

Create a pygame window, intialize CUDA, and start the camera.