#define BEAM_RMIN 0.01
#define BEAM_RMAX 0.125
#define BEAM_ENERGY 0.02
+#define BEAM_LEN 16.0
static bool init();
static void cleanup();
static unsigned int start_time;
static float beam_rot_speed = 0.1;
+static const float sil_color[] = {0.05, 0.02, 0.1, 1.0};
+static const float beam_color[] = {0.5, 0.4, 0.2, 1.0};
+
int main(int argc, char **argv)
{
glutInit(&argc, argv);
static void faros()
{
- glColor3f(0, 0, 0);
+ glColor3fv(sil_color);
// kormos
glPushMatrix();
glTranslatef(0, 4.65, 0.2);
bind_program(sdr_beam);
+ set_uniform_float(sdr_beam, "beam_len", BEAM_LEN);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
for(int i=0; i<BEAM_SHELLS; i++) {
float t = (float)i / (float)(BEAM_SHELLS - 1);
float rad = BEAM_RMIN + (BEAM_RMAX - BEAM_RMIN) * t;
- float alpha = BEAM_ENERGY / t;
+ float alpha = BEAM_ENERGY / (t * t);
- glColor4f(0.8, 0.8, 0.2, alpha);
+ glColor4f(beam_color[0], beam_color[1], beam_color[2], alpha);
- glutSolidCylinder(rad, 6, 10, 1);
+ glutSolidCylinder(rad, BEAM_LEN, 12, 1);
}
bind_program(0);
glTranslatef(0, -1.25, 0);
glScalef(1, 0.1, 1);
- glColor3f(0, 0, 0);
+ glColor3fv(sil_color);
glutSolidSphere(10, 32, 32);
glPopMatrix();