v[2] *= s;
}
+/*
static inline coord dot(vector v1, vector v2)
{
return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
}
+*/
static inline void cross(vector v1, vector v2, vector v)
{
js->color_style = COLOR_STYLE_FLOWERBOX;
return 1;
}
+# ifndef HAVE_JWZGLES /* SPHERE_MAP unimplemented */
else if(!strcmp(color, "chrome")) {
js->color_style = COLOR_STYLE_CHROME;
return 1;
}
+# endif
else if(!strcmp(color, "cycle")) {
js->color_style = COLOR_STYLE_CYCLE;
js->jiggly_color[0] = ((float)random()) / REAL_RAND_MAX * 0.7 + 0.3;
static void randomize_parameters(jigglystruct *js) {
do_tetrahedron = random() & 1;
+# ifndef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */
js->do_wireframe = !(random() & 3);
+# endif
js->color_style = random() % 5;
+# ifdef HAVE_JWZGLES /* #### SPHERE_MAP unimplemented */
+ while (js->color_style == COLOR_STYLE_CHROME)
+ js->color_style = random() % 5;;
+# endif
if(js->color_style == COLOR_STYLE_NORMAL
|| js->color_style == COLOR_STYLE_CYCLE) {
js->jiggly_color[0] = ((float)random()) / REAL_RAND_MAX * 0.5 + 0.5;
{
jigglystruct *js = &jss[MI_SCREEN(mi)];
- if(event->xany.type == ButtonPress &&
- event->xbutton.button == Button1) {
- js->button_down = 1;
- gltrackball_start(js->trackball, event->xbutton.x, event->xbutton.y,
- MI_WIDTH(mi), MI_HEIGHT(mi));
- return True;
- }
- else if(event->xany.type == ButtonRelease &&
- event->xbutton.button == Button1) {
- js->button_down = 0;
- return True;
- }
- else if (event->xany.type == ButtonPress &&
- (event->xbutton.button == Button4 ||
- event->xbutton.button == Button5 ||
- event->xbutton.button == Button6 ||
- event->xbutton.button == Button7))
- {
- gltrackball_mousewheel (js->trackball, event->xbutton.button, 10,
- !!event->xbutton.state);
- return True;
- }
- else if(event->xany.type == MotionNotify && js->button_down) {
- gltrackball_track(js->trackball, event->xmotion.x, event->xmotion.y,
- MI_WIDTH(mi), MI_HEIGHT(mi));
- return True;
- }
+ if (gltrackball_event_handler (event, js->trackball,
+ MI_WIDTH (mi), MI_HEIGHT (mi),
+ &js->button_down))
+ return True;
+
return False;
}
js->axis -= 2*M_PI;
}
}
+
gltrackball_rotate(js->trackball);
if(js->color_style == COLOR_STYLE_CYCLE) {
js = &jss[MI_SCREEN(mi)];
js->do_wireframe = MI_IS_WIREFRAME(mi);
+# ifdef HAVE_JWZGLES
+ js->do_wireframe = 0; /* GL_LINE unimplemented */
+# endif
js->shininess = shininess;
else {
MI_CLEARWINDOW(mi);
}
- js->trackball = gltrackball_init();
+ js->trackball = gltrackball_init(True);
/* _DEBUG("distance : %f\nhold : %f\nspherify : %f\ndamping : %f\ndfact : %f\n",
js->stable_distance, js->hold_strength, js->spherify_strength,
js->damping_velocity, js->damping_factor);