[quote]Should pressing ‘c’ just toggle this limit on/off?
[/quote]
/me nods
[quote]@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
[/quote]
The jars I made for lessons 1-7 on NeHe’s site are executable jars. Do they work for you?
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 ;D
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.
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?
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?
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 ;D.
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++ :’(
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
[quote]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
[/quote]
http://www.realityflux.com/abba/Lesson27.zip
Fixed code + better style + improved frame look (windowed)
Still don’t see any shadows on the walls though
(nor on the other objects, the only shadows that I see are lighting related)
[quote]the only shadows that I see are lighting related
[/quote]
That’s usually how it works ;D
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).
[quote]- Added primitive help dialog (‘F1’)
- Added frame rate limit toggle (‘c’)
Source
Binaries
[/quote]
Check the function reshape in lesson 36
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:
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
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? ???
[quote] Isn’t it better for us to have the instruction projected straight on the canvas rather than resorting to an independent dialog box?
[/quote]
I had disabled the help in fullscreen mode for now. Your idea is definitely better and has been integrated.
[quote]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.
[/quote]
I have no idea what your talking about here…
[quote] 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?
[/quote]
Laziness ;D 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.
A picture is worth a thousand word I guess :-X
http://www.realityflux.com/abba/ZPriorJFrame.jpg
http://www.realityflux.com/abba/ZPriorFJFrame.jpg
Notice 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 ;D
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
When 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 ;D
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 :