gpuray_glsl
view util/anim.c @ 1:92695e89164b
vc project
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 09 Nov 2014 14:30:37 +0200 |
parents | |
children |
line source
1 #include <stdio.h>
2 #include <math.h>
4 #define NUM_SEG 96
5 #define DIST 12
6 #define NAME "green_sphere"
7 #define FULL_TIME 10.0
8 #define BOUNCES 6.0
9 #define HEIGHT 3.5
11 int main(void)
12 {
13 int i;
14 for(i=0; i<NUM_SEG; i++) {
15 float t = (float)i / (NUM_SEG - 1);
16 float angle = 2.0 * M_PI * t;
17 float x = -cos(angle) * DIST;
18 float z = -sin(angle) * DIST;
20 float y = fabs(sin(angle * BOUNCES)) * HEIGHT;
22 printf("xform -name %s -time %.2f -pos %.2f %.2f %.2f\n",
23 NAME, t * FULL_TIME, x, y, z);
24 }
25 return 0;
26 }