Noob= How do I go about creating a fire glow effect to coat over a textured opengl object?
in
Programming Questions
•
3 years ago
Hi guys,
So basically I created a planet class using
planet_texture = TextureIO.newTexture(new File(dataPath(fileName)), true);
to texturise the planet and I would like to create a fireball glow effect.
how should I go about doing it ?
I tried tint and some basic glow effects though, they are not really effective...
So basically I created a planet class using
planet_texture = TextureIO.newTexture(new File(dataPath(fileName)), true);
to texturise the planet and I would like to create a fireball glow effect.
how should I go about doing it ?
I tried tint and some basic glow effects though, they are not really effective...
- class Planet {
PGraphicsOpenGL pgl;
GL gl;
GLU glu;
GLUquadric mysphere;
Texture planet_texture;
String fileName;
float r; //Sized to fit the texture (2048 x 1024)
Planet(String pic, float radius) {
r = radius;
fileName = pic;
pgl = (PGraphicsOpenGL) g;
gl = pgl.gl;
glu = pgl.glu;
mysphere = glu.gluNewQuadric();
glu.gluQuadricDrawStyle(mysphere, glu.GLU_FILL);
glu.gluQuadricNormals(mysphere, glu.GLU_NONE);
glu.gluQuadricTexture(mysphere, true);
try {
planet_texture = TextureIO.newTexture(new File(dataPath(fileName)), true);
/* http://apod.nasa.gov/apod/image/0203/earthtruecolor_nasa_big.jpg */
}
catch (IOException e) {
println(e);
}
}
void draw() {
pgl.beginGL();
gl.glPushMatrix();
planet_texture.enable();
planet_texture.bind();
glu.gluSphere(mysphere, r, 40, 40);
planet_texture.disable();
gl.glPopMatrix();
pgl.endGL();
}
}
1