My true colours? I did nothing but attempt to give you feedback on your code. You’re the one that reduced it to personal attacks on opinion. I’m sorry that you took it the wrong way.
Kev
My true colours? I did nothing but attempt to give you feedback on your code. You’re the one that reduced it to personal attacks on opinion. I’m sorry that you took it the wrong way.
Kev
You’re saying that I personally attacked you correct?
Can you just quote, or even mention one of em attacks that you’re accusing me of?
You can’t, simply because that never happened, on the other hand I showed the flaws in your posts and how your words are rather poorly chosen.
Go back and read what a feedback really is, all you do is forcing others to a specific coding manner that might not be viewed as pleasant or GOOD from other’s perspective.
Also saying stuff as “it speaks for itself” although coated as an opinion, is indeed a personal attack reflecting a “big” man behind an anonymous ip.
Now would you mind not addressing me anymore?
Gladly (assuming this doesn’t count)
Kev
Good boy
This tiff, heh heh a graphics joke, has gone to far. STOP IT!!! This is damaging my sense of community. :-[
This is the first time I have seen this kind of antaganism…don’t much like it. >:(
Java Cool Dude has always been helpful on the sun forums, always willing to post example code and images, most of his java3d is excellantly commented. I appreciated there and here (wish you sent jars not rars though)
I am here for IDEAS not syntax, when someone posts code here I adapt it to my system, in my style.
My day-to-day involves merging and blending code into finished apps. This code comes from a variety of sources, newbie new hires to scruffy unix guru’s. Ya just deal with different approaches. I have people who insist on m_ prefixes ala M$ and people who see no need for extra keywords like private or protected.
Let limit observations to techniques, better image hadling, nio vs regular IO.
There are most likely spelling errors in the above …tough…bummer…engrish ain’t my specialty…but I do get paid well for IDEAS!!!
While Cool’s style isn’t standard java style - from what I have seen it’s consistent so at least he sticks to his own style guidelines Code which has no apparent style is ugly to read.
And in another thread Cool was kind enough to post a zip for me with some sample full-screen code
Will.
Thanks for the good words guys, it brings a warm feeling to my heart :’(
Anyways I got per pixel lighting to work (God when I started coding it I thought I’ll never get to the end, but now that everything is under control I cna’t help but saying it was rather easy ;D)
I’ll hopefully include it into my volume shadows tonight and post it as a ZIP wink wink.
Now all I need to is to implement attenuation for more spectacular effects.
/me goes back coding but leaves a sample code
import net.java.games.jogl.GL;
import net.java.games.jogl.GLU;
public class make_room
{
jcd_math.matrix4f tangent_matrix = new jcd_math.matrix4f();
load_image texture_loader = new load_image();
String texture_path[] = {"textures/texture_base.png",
"textures/texture_dot3.png"};
float x, y, z,
texture_st[] = {0,1,
1,1,
1,0,
0,0},
geometry[] = { -1, -1, -1,
1, -1, -1,
1, 1, -1,
-1, 1, -1};/*To use in final release*/
int index,
texture_id[] = new int[2];
GL gl;
GLU glu;
make_room(float x, float y, float z,
GL gl, GLU glu){
this.glu = glu;
this.gl = gl;
this.x = x;
this.y = y;
this.z = z;
create_textures();
tangent_matrix.load_identity();
tangent_matrix.elements[5] = -1;
}
void create_textures(){
gl.glGenTextures(2, texture_id);
for(int i =0; i<2; i++){
gl.glBindTexture(gl.GL_TEXTURE_2D, texture_id[i]);
texture_loader.generate_texture_info(texture_path[i], gl.GL_RGB);
glu.gluBuild2DMipmaps(gl.GL_TEXTURE_2D, gl.GL_RGB, texture_loader.width, texture_loader.height,
gl.GL_RGB, gl.GL_UNSIGNED_BYTE,texture_loader.data);
gl.glTexParameterf(gl.GL_TEXTURE_2D,gl.GL_TEXTURE_WRAP_S,gl.GL_CLAMP_TO_BORDER_ARB);
gl.glTexParameterf(gl.GL_TEXTURE_2D,gl.GL_TEXTURE_WRAP_T,gl.GL_CLAMP_TO_BORDER_ARB);
gl.glTexParameterf(gl.GL_TEXTURE_2D,gl.GL_TEXTURE_MAG_FILTER,gl.GL_LINEAR);
gl.glTexParameterf(gl.GL_TEXTURE_2D,gl.GL_TEXTURE_MIN_FILTER,gl.GL_LINEAR_MIPMAP_LINEAR);
texture_loader.destroy();
}
}
void draw_room(){
reset_textures_state(true);
activate_textures();
jcd_math.tuple3f light_relative_position = new jcd_math.tuple3f(25,25,25),
lv = new jcd_math.tuple3f(),
lv_ts = new jcd_math.tuple3f();
gl.glBegin(gl.GL_TRIANGLE_STRIP);
lv.set(light_relative_position.x + 50f,
light_relative_position.y + 50f,
light_relative_position.z - 0f);
lv.normalize();
lv_ts.vector_matrix_mul_2(lv, tangent_matrix);
lv_ts.scale(.5f);
lv_ts.add(.5f);
gl.glMultiTexCoord2f(gl.GL_TEXTURE0_ARB, 0, 0);
gl.glMultiTexCoord2f(gl.GL_TEXTURE1_ARB, 0, 0);
gl.glColor3f(lv_ts.x,lv_ts.y,lv_ts.z);
gl.glNormal3f(0, 0, 1);
gl.glVertex3f(-50, -50, 0);
lv.set(light_relative_position.x - 50f,
light_relative_position.y + 50f,
light_relative_position.z - 0f);
lv.normalize();
lv_ts.vector_matrix_mul_2(lv, tangent_matrix);
lv_ts.scale(.5f);
lv_ts.add(.5f);
gl.glMultiTexCoord2f(gl.GL_TEXTURE0_ARB, 1, 0);
gl.glMultiTexCoord2f(gl.GL_TEXTURE1_ARB, 1, 0);
gl.glColor3f(lv_ts.x,lv_ts.y,lv_ts.z);
gl.glNormal3f(0, 0, 1);
gl.glVertex3f( 50, -50, 0);
lv.set(light_relative_position.x + 50f,
light_relative_position.y - 50f,
light_relative_position.z - 0f);
lv.normalize();
lv_ts.vector_matrix_mul_2(lv, tangent_matrix);
lv_ts.scale(.5f);
lv_ts.add(.5f);
gl.glMultiTexCoord2f(gl.GL_TEXTURE0_ARB, 0, 1);
gl.glMultiTexCoord2f(gl.GL_TEXTURE1_ARB, 0, 1);
gl.glColor3f(lv_ts.x,lv_ts.y,lv_ts.z);
gl.glNormal3f(0, 0, 1);
gl.glVertex3f(-50, 50, 0);
lv.set(light_relative_position.x - 50f,
light_relative_position.y - 50f,
light_relative_position.z - 0f);
lv.normalize();
lv_ts.vector_matrix_mul_2(lv, tangent_matrix);
lv_ts.scale(.5f);
lv_ts.add(.5f);
gl.glMultiTexCoord2f(gl.GL_TEXTURE0_ARB, 1, 1);
gl.glMultiTexCoord2f(gl.GL_TEXTURE1_ARB, 1, 1);
gl.glColor3f(lv_ts.x,lv_ts.y,lv_ts.z);
gl.glNormal3f(0, 0, 1);
gl.glVertex3f(50, 50, 0);
gl.glEnd();
reset_textures_state(false);
}
void activate_textures(){
gl.glActiveTexture(gl.GL_TEXTURE0_ARB);
gl.glBindTexture (gl.GL_TEXTURE_2D, texture_id[1]);
gl.glEnable(gl.GL_TEXTURE_2D);
gl.glTexEnvf(gl.GL_TEXTURE_ENV, gl.GL_TEXTURE_ENV_MODE, gl.GL_COMBINE_EXT);
gl.glTexEnvf(gl.GL_TEXTURE_ENV, gl.GL_COMBINE_RGB_EXT, gl.GL_DOT3_RGB_EXT);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_SOURCE0_RGB_EXT,gl.GL_TEXTURE);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_OPERAND0_RGB_EXT,gl.GL_SRC_COLOR);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_SOURCE1_RGB_EXT,gl.GL_PRIMARY_COLOR_EXT);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_OPERAND1_RGB_EXT,gl.GL_SRC_COLOR);
gl.glActiveTexture(gl.GL_TEXTURE1_ARB);
gl.glBindTexture (gl.GL_TEXTURE_2D, texture_id[0]);
gl.glEnable(gl.GL_TEXTURE_2D);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_TEXTURE_ENV_MODE,gl.GL_COMBINE_EXT);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_COMBINE_RGB_EXT,gl.GL_MODULATE);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_SOURCE0_RGB_EXT,gl.GL_PREVIOUS_EXT);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_OPERAND0_RGB_EXT,gl.GL_SRC_COLOR);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_SOURCE1_RGB_EXT,gl.GL_TEXTURE);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_OPERAND1_RGB_EXT,gl.GL_SRC_COLOR);
}
void reset_textures_state(boolean all){
gl.glActiveTexture(gl.GL_TEXTURE0_ARB);
gl.glMatrixMode(gl.GL_TEXTURE);
gl.glLoadIdentity ();
gl.glMatrixMode(gl.GL_MODELVIEW);
gl.glDisable(gl.GL_TEXTURE_3D_EXT);
gl.glDisable(gl.GL_TEXTURE_CUBE_MAP_ARB);
gl.glDisable(gl.GL_TEXTURE_2D);
gl.glDisable(gl.GL_TEXTURE_GEN_S);
gl.glDisable(gl.GL_TEXTURE_GEN_T);
gl.glDisable(gl.GL_TEXTURE_GEN_R);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_TEXTURE_ENV_MODE,gl.GL_MODULATE);
gl.glActiveTexture(gl.GL_TEXTURE1_ARB);
gl.glMatrixMode(gl.GL_TEXTURE);
gl.glLoadIdentity ();
gl.glMatrixMode(gl.GL_MODELVIEW);
gl.glDisable(gl.GL_TEXTURE_3D_EXT);
gl.glDisable(gl.GL_TEXTURE_CUBE_MAP_ARB);
gl.glDisable(gl.GL_TEXTURE_2D);
gl.glDisable(gl.GL_TEXTURE_GEN_S);
gl.glDisable(gl.GL_TEXTURE_GEN_T);
gl.glDisable(gl.GL_TEXTURE_GEN_R);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_TEXTURE_ENV_MODE,gl.GL_MODULATE);
if(all){
gl.glActiveTexture(gl.GL_TEXTURE2_ARB);
gl.glMatrixMode(gl.GL_TEXTURE);
gl.glLoadIdentity ();
gl.glMatrixMode(gl.GL_MODELVIEW);
gl.glDisable(gl.GL_TEXTURE_3D_EXT);
gl.glDisable(gl.GL_TEXTURE_CUBE_MAP_ARB);
gl.glDisable(gl.GL_TEXTURE_2D);
gl.glDisable(gl.GL_TEXTURE_GEN_S);
gl.glDisable(gl.GL_TEXTURE_GEN_T);
gl.glDisable(gl.GL_TEXTURE_GEN_R);
gl.glTexEnvf(gl.GL_TEXTURE_ENV,gl.GL_TEXTURE_ENV_MODE,gl.GL_MODULATE);
}
}
void call_texture_coord(int index, int w, int h){
switch(index){
case 1: gl.glTexCoord2f(0,h); break;
case 2: gl.glTexCoord2f(w,h); break;
case 3: gl.glTexCoord2f(w,0); break;
case 4: gl.glTexCoord2f(0,0); break;
}
}
}
[quote]While Cool’s style isn’t standard java style - from what I have seen it’s consistent so at least he sticks to his own style guidelines Code which has no apparent style is ugly to read.
[/quote]
It can’t be really consistent, because the style of method-calls to the Java/Jogl core is different from calling Cool’s own methods. You will always have to jump between the styles (for instance isEmpty() and is_empty()). Nevertheless I agree this discussion is not good for the community-feeling.