[java] Getting more speed out of java

Started by
2 comments, last by Kosh 24 years, 1 month ago
Hello everyone, I am interested in getting more speed out of java and well, I want to write a small but fast (enough) polygon engine, just something that can draw polygons, filling them in with a solid colour, no lightsourcing yet, just the polygons will do. But I have a question, how the hell to get more speed out of java. It''s terribly slow at even drawing a few pixels onto a 640x480 frame, let alone a full on fillpoly() routine. So, does anyone have any suggestions ? I am using MemorySourceImage as well, just in case someone suggests that, I am already using it, but apart from that, I am not sure about how I can get more speed. I have hash tabled the cos and sin values for use when rotating, this is done once for each object (done this way cause at the moment, I only have one object so....) anyone have any bright ideas kosh
if understanding it made and born with time, then time, is understandings greatest enemy.....
Advertisement
you can go and check this java engine :
http://www2.active.ch/~proxima/idx3d/idx3d.htm

You can use Opengl :
http://www.jausoft.com/gl4java/

or the java3d API (OpenGL or Direct3D):
http://java.sun.com

and it''ll help you.

You could use a JIT compiler, as well.
Can''t help you more cause I''m tired and have many things to do ;o)

-* Sounds, music and story makes the difference between good and great games *-
-* So many things to do, so little time to spend. *-
The black art of java game programming has a nice Polygon 3D engine and it runs at about 60 fps. Go to a book store and buy it or read it there. Since you''re already in the process of making one you should be able to pick up on their method easily.
Neat trick for everyone, use optimize code toggle in your compieler, it proviedes small speed increase. Also finalize your paint and draw everything in update.

Final public void paint(Graphics g)
{
update(g);
}

public void update(Graphics g)
{
}
Do it something like this. It is faster if you do use canvas or applet


Time comes, time goes and I only am.

This topic is closed to new replies.

Advertisement