Image Rendering (PBR) & 360° Spins for Thumbnails


Important Note

Outdated Version:
You are looking at an outdated documentation version for an older RapidCompact CLI distribution. If you are using a newer version of the CLI please refer to the documentation of the current CLI release version.

< previous page

Since it can easily be installed on servers an does not require a GPU, RapidCompact CLI can also be conveniently used to generate images of 3D models. This is useful, for example, when you have a large set of meshes and want to create thumbnail images. You can also use RC to render a turntable-like image series, rotating around the up-axis of a given mesh. Such an image series can then be used to display a pseudo-3D view of a 3D model (for example, inside a Web page). Image generation (or rendering) commands share the following common settings:

Setting Name: rendering:imageWidth (similar: rendering:imageHeight)
Setting Type: Integer Number
Valid Range: [1, 8192]
Default Value: 1024
Description: Specifies the width (similar: height) for rendered images.
Setting Name: rendering:background
Setting Type: String
Valid Values: transparent, white, black, gradientGray
Default Value: transparent
Description: Specifies the background to be used when rendering images.
Setting Name: rendering:showBackFaces
Setting Type: Flag
Valid Values: true, false
Default Value: false
Description: Specifies whether faces with a surface normal pointing away from the viewer ("backfaces") should be rendered.

If a model should be rendered using a certain camera position and orientation, the following command set_view_matrix can be used:

Command: set_view_matrix
Shorthand: v
Argument: matrix in format "m00 m01 m02 m03 m10 m11 m12 m13 m20 m21 m22 m23"
Example: rpdx -i foo.obj -v "1 0 0 0 0 1 0 0 0 0 1 -1000" --render_image foo.png
Description: Sets the view matrix, used for rendering, to the given matrix. The 3x4 matrix in row major format must be specified as a single, whitespace-separated string, wrapped in quotes.

If no view matrix is explicitly set, the model is rendered with the camera fitting to the scene, looking along the negative z-axis (if the system was not rotated). The commands for generating images are shown in the following.

Images generated with different backgrounds. Background names from left to right: "transparent", "white", "black", "gradientGray".
Command: render_image
Shorthand: none
Argument: filename of the resulting image file
Example: rpdx -i myMesh.ply --render_image mesh.png
Description: Renders an image of a mesh and stores it to the given image file. Supported image formats are PNG and JPEG.
Command: render_turntable
Argument 1: directory for images
Argument 2: number of views / images to render
Example: rpdx -i foo.obj --render_turntable meshTT 32
Description: Renders a turntable-like image series by centering the asset and rotating the view around the up-axis. The resulting images will be stored in PNG format.
< previous page