HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

Go Back   HardwareHeaven.com > Forums > Software / Tools > Programming, Coding, (Web)Design


Programming, Coding, (Web)Design Discuss all your programming or design needs with likeminded people.

Reply
 
Thread Tools
Old May 4, 2003, 06:08 AM   #1
Java programmer
 
Join Date: May 2002
Location: Massachusetts
Posts: 125
Rep Power: 0
crazy overclock is on a distinguished road

Big Grin Time for opinions

First you guys should download the JRE 1.4.2 as it boosts Java overall speed.
You can grab it here; it really got me thinking again about java performance.
Now 2D bump map appreciation time:
I coded this applet not that long ago, yet I still feel like there is something missing.
I can't put my hand on it as of yet, so let me collect your opinions and thoughts.
bumpmapping
To stop the light from tracking the cursor, just press the mouse left button and drag it out the applet.

Side note; this is how I compute per-pixel normals
Code:
  public vec3f normalAtVertex(point3f cen,point3f p1,point3f p2,
                              point3f p3 ,point3f p4,point3f p5,
                              point3f p6)
  {
                              /****************
                              *       p1  p6  *
                              *       o---o   *
                              *   p2/ | / |   *
                              *   o -cen- o   *
                              *   | / | / p5  *
                              *   o---o       *
                              *   p3  p4      *
                              ****************/

    vec1 = new vec3f(p1.x-cen.x, p1.y-cen.y, p1.z-cen.z);
    vec2 = new vec3f(p2.x-cen.x, p2.y-cen.y, p2.z-cen.z);
    vec3 = new vec3f(p3.x-cen.x, p3.y-cen.y, p3.z-cen.z);
    vec4 = new vec3f(p4.x-cen.x, p4.y-cen.y, p4.z-cen.z);
    vec5 = new vec3f(p5.x-cen.x, p5.y-cen.y, p5.z-cen.z);
    vec6 = new vec3f(p6.x-cen.x, p6.y-cen.y, p6.z-cen.z);

    nor1.cross(vec1,vec2);
    nor2.cross(vec2,vec3);
    nor3.cross(vec3,vec4);
    nor4.cross(vec4,vec5);
    nor5.cross(vec5,vec6);
    nor6.cross(vec6,vec1);

    vertexNormal = (inWards) ? new vec3f(-(nor1.x + nor2.x + nor3.x + nor4.x + nor5.x + nor6.x),
                                         -(nor1.y + nor2.y + nor3.y + nor4.y + nor5.y + nor6.y),
                                         -(nor1.z + nor2.z + nor3.z + nor4.z + nor5.z + nor6.z))
                             : new vec3f( nor1.x + nor2.x + nor3.x + nor4.x + nor5.x + nor6.x,
                                          nor1.y + nor2.y + nor3.y + nor4.y + nor5.y + nor6.y,
                                          nor1.z + nor2.z + nor3.z + nor4.z + nor5.z + nor6.z);
    vertexNormal.normalize();

    return vertexNormal;
  }
If interested in source code, just let me know; I'll be glad to share
crazy overclock is offline   Reply With Quote


Old May 4, 2003, 09:47 AM   #2
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0
UberLord will become famous soon enough

Crashed

load: class bump_map.class not found.
java.lang.ClassNotFoundException: bump_map.class

I'm using BlackDown JRE 1.4.1 for Linux (pretty much the same as Suns JRE 1.4.1)
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old May 4, 2003, 09:51 AM Threadstarter Thread Starter   #3
Java programmer
 
Join Date: May 2002
Location: Massachusetts
Posts: 125
Rep Power: 0
crazy overclock is on a distinguished road

Re: Crashed

Quote:
Originally posted by UberLord
load: class bump_map.class not found.
java.lang.ClassNotFoundException: bump_map.class

I'm using BlackDown JRE 1.4.1 for Linux (pretty much the same as Suns JRE 1.4.1)
Um you might wanna dld the new runtime environment; the same error happened to few people I know, however updating JRE fixed that .
Still using the 1.4.1 should allow the applet to run.
/me back coding.
PS: I use SDK 1.4.2 to produce my demos
crazy overclock is offline   Reply With Quote
Old May 4, 2003, 09:54 AM   #4
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0
UberLord will become famous soon enough

Erm - isn't 1.4.2 still in beta?
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old May 4, 2003, 09:56 AM Threadstarter Thread Starter   #5
Java programmer
 
Join Date: May 2002
Location: Massachusetts
Posts: 125
Rep Power: 0
crazy overclock is on a distinguished road

Quote:
Originally posted by UberLord
Erm - isn't 1.4.2 still in beta?
True, but the performance leap over the "offical" releases is quite worth testing around
crazy overclock is offline   Reply With Quote
Old May 4, 2003, 10:15 AM   #6
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0
UberLord will become famous soon enough

Crashed out with the same error using Sun's 1.4.2 beta for linux
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old May 4, 2003, 11:16 AM Threadstarter Thread Starter   #7
Java programmer
 
Join Date: May 2002
Location: Massachusetts
Posts: 125
Rep Power: 0
crazy overclock is on a distinguished road

Umm I don't see why would it do that
Btw for those who got it to work, what fps do yo uget at default settings?
On my Athlon 1.35 384 DDR I get around 22-23fps that sinks down 17-19 when radius is maximized.
crazy overclock is offline   Reply With Quote
Old May 6, 2003, 01:57 PM   #8
Wolfish Bastard
 
Join Date: May 2002
Location: Cave; Ozark Mountains
Posts: 2,110
Rep Power: 0
WyreTheWolf is on a distinguished road

Donator
nifty effects... with the default settings I get 38 - 40 fps... maxed out.. I get about 30 - 33 fps I hope that is of some help.
WyreTheWolf is offline   Reply With Quote
Old May 6, 2003, 02:38 PM   #9
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0
UberLord will become famous soon enough

Same error on my XP box at work using 1.4.2 beta

here's the full error text incase it means something to you

Code:
java.lang.ClassNotFoundException: bump_map.class
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.loadCode(Unknown Source)
	at sun.applet.AppletPanel.createApplet(Unknown Source)
	at sun.plugin.AppletViewer.createApplet(Unknown Source)
	at sun.applet.AppletPanel.runLoader(Unknown Source)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException: open HTTP connection failed.
	at sun.applet.AppletClassLoader.getBytes(Unknown Source)
	at sun.applet.AppletClassLoader.access$100(Unknown Source)
	at sun.applet.AppletClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	... 10 more
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Old May 6, 2003, 04:53 PM   #10
A Legend in Underwear
 
UberLord's Avatar
 
Join Date: May 2002
Location: Unknown
Posts: 5,255
Rep Power: 0
UberLord will become famous soon enough

Update - it works fine in IE but not Mozilla. Can you try it using Mozilla and see what the problem is?
__________________
Gentoo Linux - Developer (baselayout)
Read my blog

"I contend that we are both atheists. I just believe in one fewer god than you do. When you understand why you dismiss all the other possible gods, you will understand why I dismiss yours."
Stephen Roberts
UberLord is offline   Reply With Quote
Reply

Thread Tools