pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #90 - Posted
2003-09-23 20:14:57 » |
|
Ok, I hope everything works ok this time. I've tested each demo on windows in a separate directory, and they work for me now. I've also added a build script that generates the executable jars. SourceBinaries
|
|
|
|
|
Caoimhin
|
 |
«
Reply #91 - Posted
2003-09-23 20:27:48 » |
|
Another silly question. Why's jogl.jar included in the source tree? I don't think that's something we should be distributing. A link or docs on how to get jogl would be better. Is it actually needed? It seems to me that if it is, it'd cause version conflicts. It's also adding 500k to the size of your zip.
|
|
|
|
|
pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #92 - Posted
2003-09-23 20:36:28 » |
|
It's needed to compile the the demos of course. I'll replace it with a text file explaining where to get it. I'm going to finish lesson 36 first though. I seem to have fogotten to port it.
Edit: - Removed jogl.jar from the source zip - Added lesson 36
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
quintesse
Junior Member  
Java games rock!
|
 |
«
Reply #93 - Posted
2003-09-23 21:45:04 » |
|
@pepijnve: Damn, there's got to be something else wrong on my system then because the new demos still won't run using the jars (keep getting class not found errors for GLEventListener) 
|
|
|
|
|
pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #94 - Posted
2003-09-23 22:04:23 » |
|
You need to make sure jogl.jar is somewhere in the classpath. On my test system I put it in lib/ext in the jre install directory, so that it's available system wide. I could also put it in the manifest in the classpath entry so that it is automatically used if you put it in the same directory as the lesson jar files. Anybody have a suggestion on how this problem canbest be solved?
|
|
|
|
|
Scott_Y._Hong
Guest
|
 |
«
Reply #95 - Posted
2003-09-23 22:43:07 » |
|
Hi, Please add the following "xml lines" to the "build.xml" file to be able to run all the demo lessors.
<!-- Please download and put jogl.jar under the lib directory. For Win32: copy these two "dll"s file at the same location as this buildfile. For Linux: copy these two "so"s files under jre/lib/i386 --> <target name="run-jars" depends="prepare,compile"> <antcall target="run-lesson-jar"><param name="lesson.number" value="01"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="02"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="03"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="04"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="05"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="06"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="07"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="08"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="09"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="11"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="12"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="14"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="17"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="18"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="20"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="22"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="23"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="24"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="26"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="27"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="29"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="30"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="33"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="34"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="36"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="37"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="39"/></antcall> <antcall target="run-lesson-jar"><param name="lesson.number" value="42"/></antcall> </target> <target name="run-lesson-jar"> <property name="main.class" value="demos.nehe.lesson${lesson.number}.Lesson${lesson.number}"/> <java fork="yes" classname="${main.class}" taskname="${lesson.number}" failonerror="true"> <!-- put build, data and jogl.jar into classpath --> <classpath> <pathelement location="build" /> <pathelement location="data" /> <fileset dir="lib"> <include name="**/*.jar"/> </fileset> </classpath> </java> </target>
|
|
|
|
|
Caoimhin
|
 |
«
Reply #96 - Posted
2003-09-23 22:46:10 » |
|
Java Webstart and the extensions to load external dlls. This is an old article, but we might be able to adapt it for JoGL. http://www.j3d.org/tutorials/quick_fix/auto_install.htmlBoth JoGL and Java3D suffer from the same problem. There's no easy installation path for the external libs. At least JoGL doesn't seem to have export restrictions as Java3D did. These beginner tutorials seem to be getting more and more complicated.
|
|
|
|
|
Java Cool Dude
|
 |
«
Reply #97 - Posted
2003-09-24 03:52:25 » |
|
I've got some time now to work on the next tutorial, but I'm a big confused now.
Are we going with a common framework? If not, is pepijnve going to continue to port work to the framework for the jogl demos? Are we going to have to maintain two versions? One for nehe.gamedev.net and one for jogl-demos.java.net? Updating code between two sites is going to be a bear without CVS write access. And nehe updates his site by hand.
I'm adopting a hybrid frame that's basically the best of mine and pepi mixed up together. We also use the same bitmap loader and some other classes (Math  ). Back to pepi, dude throw in a cap "c" button where the frame rate is controlled by the user rather by a defined static limit.(think of it as capped to xx fps, or simply uncapped) I had to modify your code to get decent speeds and draw a comparaison performance wise between the code in C++ and Java.
|
|
|
|
|
pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #98 - Posted
2003-09-24 08:23:51 » |
|
Caoimhin: nobody formally agreed on using a common framework. I spent some time merging all the existing code together using the 'framework' I made to get a more uniform feel. JavaCoolDude: I'm not sure I understand 100% what you mean with the 'c' button. Right now the frame rate is capped to 60fps in a rather crude way. Should pressing 'c' just toggle this limit on/off? If you have any enhancements to the code in demos/nehe/common feel free to send them to me. I guess we really should start using cvs to avoid any mixups in the future. Scott_Y._Hong: Is it useful to have 'run' targets in a build script? The lesson jars are executable and contain the data files they depend on, so personally I don't see a need for this. What do the other guys think about this?
|
|
|
|
|
quintesse
Junior Member  
Java games rock!
|
 |
«
Reply #99 - Posted
2003-09-24 10:51:52 » |
|
@pepijnve: it _is_ somewhere in the classpath otherwise doing "java demos.nehe.lesson01.Lesson01" wouldn't work either. No, it's just the jars that won't work. Even ones that I made myself for some personal projects, so it definitely is something that changed for the worse on my system 
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Java Cool Dude
|
 |
«
Reply #100 - Posted
2003-09-24 14:08:21 » |
|
Should pressing 'c' just toggle this limit on/off? /me nods
|
|
|
|
|
Caoimhin
|
 |
«
Reply #101 - Posted
2003-09-24 14:54:33 » |
|
@pepijnve: it _is_ somewhere in the classpath otherwise doing "java demos.nehe.lesson01.Lesson01" wouldn't work either. No, it's just the jars that won't work. Even ones that I made myself for some personal projects, so it definitely is something that changed for the worse on my system  The jars I made for lessons 1-7 on NeHe's site are executable jars. Do they work for you?
|
|
|
|
|
pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #102 - Posted
2003-09-24 15:01:13 » |
|
I just checked the manifest of these jars, and they contain essentially the same entries as mine. So if yours work and mine don't something very strange is happening 
|
|
|
|
|
Caoimhin
|
 |
«
Reply #103 - Posted
2003-09-24 15:15:10 » |
|
Right, that's what I was thinking. The only difference is I didn't use packages.
I've been running awhile with JoGL in my JDK but not my JRE. When double-clicking on a jar or selecting one from a webpage in IE, I get an error that reads "Could not find the main class. Program will exit!"
Of course, when I move the jars and dlls back into my JRE's lib/etc directory, everything works fine again.
I just tested pepijnve's jars and they seem to work fine -- as long as I'm correctly configured.
|
|
|
|
|
quintesse
Junior Member  
Java games rock!
|
 |
«
Reply #104 - Posted
2003-09-24 17:37:04 » |
|
Well, after copying the jar and dlls to lib/ext and bin respectively everything works.
I still don't understand why "java demos.nehe.lessonXX.LessonXX" would work and "java -jar lesson01.jar" wouldn't though. But at least it works now and that is the most important.
I do have another strange thing though: lesson08 isn't using alpha blending on my system? Any ideas why?
|
|
|
|
|
pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #105 - Posted
2003-09-24 18:16:00 » |
|
It's off by default. Press 'b' to toggle it on/off. Maybe I should add a tiny help thing to the common framework, so that pressing F1 for instance shows a help dialog with the available keyboard controls?
|
|
|
|
|
Java Cool Dude
|
 |
«
Reply #106 - Posted
2003-09-24 23:41:45 » |
|
Yup a help Dialog box would be cool, I can work on that really quick if you want, but I doubt you'd let anyone get away with such fun, coding that is  . I' done with Quake 3 Loader and I'll be posting the code tonight. The animation will take more time and work but it'll be done eventually  PS: Lesson 37, 34 and this loader disappointed me big time seeing how slow looping is in Java compared to C/C++ 
|
|
|
|
|
chiraz
Junior Newbie
Java games rock!
|
 |
«
Reply #107 - Posted
2003-09-25 07:35:29 » |
|
Hi all,
New to Jogl. I'm just wrapping my head around it for now.
I'm looking through the tutorials being created now, they're excellent reference material. Number 27 is a bit strange, it seems to create shadows on the object, but not shadows on the wall. I'm wondering if it has to do with the setting of the near clipping plane and what value I might be able to tweak to get it to work.
Cheers,
Chiraz
|
|
|
|
|
Java Cool Dude
|
 |
«
Reply #108 - Posted
2003-09-25 08:37:12 » |
|
Hi all,
New to Jogl. I'm just wrapping my head around it for now.
I'm looking through the tutorials being created now, they're excellent reference material. Number 27 is a bit strange, it seems to create shadows on the object, but not shadows on the wall. I'm wondering if it has to do with the setting of the near clipping plane and what value I might be able to tweak to get it to work.
Cheers,
Chiraz
http://www.realityflux.com/abba/Lesson27.zipFixed code + better style + improved frame look (windowed)
|
|
|
|
|
quintesse
Junior Member  
Java games rock!
|
 |
«
Reply #109 - Posted
2003-09-25 11:21:45 » |
|
Still don't see any shadows on the walls though  (nor on the other objects, the only shadows that I see are lighting related)
|
|
|
|
|
swpalmer
|
 |
«
Reply #110 - Posted
2003-09-25 12:12:50 » |
|
the only shadows that I see are lighting related That's usually how it works 
|
|
|
|
quintesse
Junior Member  
Java games rock!
|
 |
«
Reply #111 - Posted
2003-09-25 13:02:38 » |
|
Mister smartiepants  I knew somebody would make this remark, what I of course referred to when I said talked about lighting was OpenGL's lighting which is not capable of _casting_ shadows. So when I say I don't see any shadows I mean the ones that get explicitly drawn by the code (using stencils in the case of this demo).
|
|
|
|
|
pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #112 - Posted
2003-09-25 19:18:30 » |
|
- Added primitive help dialog ('F1') - Added frame rate limit toggle ('c') SourceBinaries
|
|
|
|
|
Java Cool Dude
|
 |
«
Reply #113 - Posted
2003-09-25 20:34:09 » |
|
- Added primitive help dialog ('F1') - Added frame rate limit toggle ('c') SourceBinariesCheck the function reshape in lesson 36 
|
|
|
|
|
Java Cool Dude
|
 |
«
Reply #114 - Posted
2003-09-25 20:46:19 » |
|
Two quick suggestions: Isn't it better for us to have the instruction projected straight on the canvas rather than resorting to an independent dialog box? The reason behind this thought is that in fullscreen mode, there is no way one could access such information. Here's an alternative method for getting quick help while running in full screen: From my Quake 3 model loader: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| void keyboardMapping(){
int viewPort[] = new int[4]; gl.glPushMatrix(); gl.glLoadIdentity(); gl.glMatrixMode(gl.GL_PROJECTION); gl.glPushMatrix (); gl.glLoadIdentity();
gl.glDisable(gl.GL_TEXTURE_2D); gl.glGetIntegerv (gl.GL_VIEWPORT, viewPort); glu.gluOrtho2D(0,viewPort[2], viewPort[3], 0); gl.glDepthFunc(gl.GL_ALWAYS); gl.glColor3f (1,1,1);
gl.glRasterPos2f(15, 15); glut.glutBitmapString(gl,glut.BITMAP_HELVETICA_12, "W: Toggle Wire"); gl.glRasterPos2f(15, 30); glut.glutBitmapString(gl,glut.BITMAP_HELVETICA_12, "F1: Help"); gl.glRasterPos2f(15, 45); glut.glutBitmapString(gl,glut.BITMAP_HELVETICA_12, "UP: Zoom in"); gl.glRasterPos2f(15, 60); glut.glutBitmapString(gl,glut.BITMAP_HELVETICA_12, "Down: Zoom Out"); gl.glRasterPos2f(15, 75); glut.glutBitmapString(gl,glut.BITMAP_HELVETICA_12, "Left: Spin Left"); gl.glRasterPos2f(15, 90); glut.glutBitmapString(gl,glut.BITMAP_HELVETICA_12, "Right: Spin Right");
gl.glDepthFunc(gl.GL_LESS); gl.glPopMatrix(); gl.glMatrixMode(gl.GL_MODELVIEW); gl.glPopMatrix (); gl.glEnable(gl.GL_TEXTURE_2D); } |
Second though is, I changed my JFrame setting a bit so not only the title bar would look prettier, which is of course a matter of personal taste, but also, when set to full screen, that same bar is the only part displayed by the video card beside your GL canvas. What I'm trying to say here is that the "annoying" windows task bar usually but not always located in the bottom part of the screen loses its Z priority to the JFrame. Here's the code for it 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| public static void main(String []args) {
int fullScreen = JOptionPane.showConfirmDialog( null, "Would you like to run in fullscreen mode?", "Fullscreen", JOptionPane.YES_NO_OPTION); if(fullScreen!=0) JFrame.setDefaultLookAndFeelDecorated(true);
frame = new JFrame("Quake3 Loader"); demo = new Quake3Loader(); screenWidth = Toolkit.getDefaultToolkit().getScreenSize().width; screenHeight = Toolkit.getDefaultToolkit().getScreenSize().height;
switch(fullScreen){ case 0: frame.setUndecorated(true); break; default: canvasWidth = 640; canvasHeight = 480; xLocation = (screenWidth - canvasWidth )>>1; yLocation = (screenHeight - canvasHeight)>>1; frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocation(xLocation,yLocation); }
frame.getContentPane().add(demo.getCanvas(canvasWidth, canvasHeight), BorderLayout.CENTER); frame.pack(); frame.requestFocus(); frame.setVisible(true);
if(fullScreen==0){ GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().setFullScreenWindow(frame); GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().setDisplayMode((new DisplayMode(1024, 768, 32, 85))); } } |
Finally in lesson 34, which is the height mapping I believe, I see that you took off mouse support and replaceed the call to the toggle wire on/off function with the space bar. Question is, why? 
|
|
|
|
|
pepijnve
Junior Member  
Java games rock!
|
 |
«
Reply #115 - Posted
2003-09-25 22:54:29 » |
|
Isn't it better for us to have the instruction projected straight on the canvas rather than resorting to an independent dialog box? I had disabled the help in fullscreen mode for now. Your idea is definitely better and has been integrated. What I'm trying to say here is that the "annoying" windows task bar usually but not always located in the bottom part of the screen loses its Z priority to the JFrame. I have no idea what your talking about here... Finally in lesson 34, which is the height mapping I believe, I see that you took off mouse support and replaceed the call to the toggle wire on/off function with the space bar. Question is, why? Laziness  I made a quick help mechanism for key strokes and was too lazy to add the equivalent for mouse stuff. I've restored this functionality to its original state and added mouse event support to the help display. I've updated the zips on my server again, with the changes mentioned above integrated. I also added lesson 45.
|
|
|
|
|
Java Cool Dude
|
 |
«
Reply #116 - Posted
2003-09-26 03:24:31 » |
|
I have no idea what your talking about here...
A picture is worth a thousand word I guess http://www.realityflux.com/abba/ZPriorJFrame.jpghttp://www.realityflux.com/abba/ZPriorFJFrame.jpgNotice in the first scrrenshot when fullscreen is set through the JFrame's maximize button, the Z priority is stolen from windows task bar and hence it doesn't show up. To accomplish such effect which results in the demo's gaining more display area, we call (JFrame.setDefaultLookAndFeelDecorated(true)  before initiating the frame  PS: The extended desktop is due to the fact that I have dual screens 
|
|
|
|
|
scottellsworth
Junior Newbie
Java games rock!
|
 |
«
Reply #117 - Posted
2003-09-30 21:29:41 » |
|
Hey - wonderful work, folks. I have learned quite a bit from these tutorials.
It appears that pretty much everything up to roughly lesson 34 has been ported at this point, at least looking at NeHe's site.
Are there any waiting in the wings that have not yet made it into the public eye?
Scott
|
|
|
|
|
Java Cool Dude
|
 |
«
Reply #118 - Posted
2003-10-02 04:12:26 » |
|
Lesson44: Lens Flare TutorialWhen I sat down and started porting this demo, it was around 7:30PM EST, now when I take a look at my clock it says 12:10 AM.... Damn someone throw me a life  Anyways my unique comment regarding this port is the fact that it runs slightly faster than the equivalent demo in C++. Java 1 C++ 0  /\ Double post 
|
|
|
|
|
|