api index


graphicsDeploy api:
render.h

Library for rendering models created using functions in model.h and keyframe.h. The basic job of render.h is to take the model entities given by model.h and turn them into line segments and triangles in screen space, and then draw them to the image in question.


rendering functions

render_scene() renders the specified world scene without applying keyframing info at any of the nodes (all nodes are treated as PASSIVE). render_frame() renders a single frame at the specified time, using keyframe info for KEYED nodes. render_batch() renders the frame range specified in the rendering parameters, using the frames_per_second to specify the corresponding range in time, and writing image files as specified by filename_prefix and frame_padding (a four-padded frame with the prefix "image" might look like "image.0042.ppm")

struct Image *render_scene(struct Node *world, struct RenderParams *params);
struct Image *render_frame(struct Node *world, struct RenderParams *params, double time);
int render_batch(struct Node *world, struct RenderParams *params)

rendering parameters

set various parameters for rendering (which camera to use, what the background looks like, frame-range for batch-rendering, etc.). There are a series of functions to initialize and manipulate render parameter structs so that the user need never actually muck around with the structs directly.

typedef enum {NONE, LOW} AntialiasMode;

struct RenderParams *init_render_params(void);

int set_shading_limit(struct RenderParams *params, ShadingType limit);
int set_specularity_limit(struct RenderParams *params, ShadingType limit);
int set_antialias(struct RenderParams *params, AntialiasMode antialias);
int set_transparency_usage(struct RenderParams *params, short use_transparency);
int set_shadow_usage(struct RenderParams *params, short use_shadows);
int set_color_map_usage(struct RenderParams *params, short use_color_maps);
int set_point_light_jittering(struct RenderParams *params, short pl_jitter);

int set_ambient_light(struct RenderParams *params, Color ambient_light);
int set_bg_color(struct RenderParams *params, Color bg_color);
int set_bg_image(struct RenderParams *params, struct Image *bg_image);
int load_bg_image(struct RenderParams *params, char *bg_image_filename);

int set_camera(struct RenderParams *params, struct Node *camera);
int set_resolution(struct RenderParams *params, long width, long height);

int set_frame_rate(struct RenderParams *params, double frame_rate);
int set_frame_range(struct RenderParams *params,
   int frame_start, int frame_stop);
int set_filename_prefix(struct RenderParams *params, char *filename_prefix);
int set_frame_padding(struct RenderParams *params, int frame_padding);


parameter defaults

#define DEFAULT_WIDTH 320
#define DEFAULT_HEIGHT 240
#define DEFAULT_FRAME_RATE 30.0
#define DEFAULT_FRAME_START 0
#define DEFAULT_FRAME_STOP 30
#define DEFAULT_FILE_PREFIX "image"
#define DEFAULT_SHADING GOURAUD_SHADING
#define DEFAULT_SPECULARITY PHONG
#define DEFAULT_TRANSPARENCY FALSE
#define DEFAULT_SHADOW_CASTING FALSE
#define DEFAULT_BG_COLOR BLACK
#define DEFAULT_AMBIENT_LIGHT newColor(30,30,30)



api index