1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
/* rendering consts */
#define BALL_SIZE 0.27
#define AMBIENCE_MAX 0.025
#define TRIPLE_SCALE 0.65
#define DOUBLE_SCALE 0.8
#define POVRAY_FONT "timrom.ttf"
/* convert from gdis pixel offset to OpenGL cartesian Angs */
#define PIX2ANG 0.03
/* unified render (povray & openGL) */
enum
{
STICK, BALL_STICK, CPK, LIQUORICE, POLYHEDRAL, ZONE,
LIGHT_TYPE, DIRECTIONAL, POSITIONAL,
SCALE, HALO_QUALITY, FAST_ROTATION,
ANTIALIAS, SHADOWLESS, DRAW_AXES, PERSPECTIVE, WIRE_FRAME, FOG,
ANIMATE, ANIMATE_TYPE, ANIM_GIF, ANIM_MPEG, ANIM_NAME, ANIM_FRAME,
MORPH_STYLE, MORPH_FINISH
};
/************************/
/* rendering structures */
/************************/
/* TODO - move model to this & replace model->scale with zoom */
struct camera_pak
{
gint mode; /* free/locked */
gint perspective; /* true/false */
gdouble fov; /* perspective field of view */
gdouble zoom; /* zoom/scale factor */
gdouble x[3]; /* position */
gdouble o[3]; /* orientation vector */
gdouble v[3]; /* viewing vector */
gdouble e[3]; /* crossproduct of viewing and orientation */
gdouble q[4]; /* quaternion modifier */
};
struct light_pak
{
gint type;
gdouble x[3];
gdouble colour[3];
gdouble ambient;
gdouble diffuse;
gdouble specular;
};
/* TODO - replace with general render pak? */
struct povray_pak
{
gint background; /* colour */
gint camera[3];
gint num_lights;
gint shadowless;
gint animate;
gint atype;
gint axes;
gint delay;
gdouble ambience;
gdouble frad; /* frame radius */
gchar filename[FILELEN];
gint wire_frame;
gdouble ref_index;
gdouble transmit;
gchar morph_finish[LINELEN];
};
/* prototypes */
void render_make_pipes(GSList **, struct model_pak *);
GSList *render_get_pipes(gint, gint, gint, struct model_pak *);
GSList *render_sort_pipes(GSList *);
void create_polyhedra(struct model_pak *);
void destroy_polyhedra(struct model_pak *);
void povray_task(void);
void povray_exec(gchar *);
|