Show Posts
|
|
Pages: [1]
|
|
1
|
Java Game APIs & Engines / JOGL Development / Re: the bottom is not drawn
|
on: 2005-04-10 17:33:59
|
hmm maybe i should delet the comments from the bottom... its the same bottom size like a quad... so i copied it ... but it is the bottom of the pyramide.... The comments don't matter, they're not processed. My guess is that the system becomes confused once it stops doing triangles because of the extra vertex. At any rate, doing it the way I posted makes it work (whereas doing it the way you did doesn't render the bottom to me either). Here, check this out: 
|
|
|
|
|
2
|
Java Game APIs & Engines / JOGL Development / Re: the bottom is not drawn
|
on: 2005-04-10 14:15:55
|
|
I can't believe I'm the one replying to a request for help, I'm greener than glColor3f(0.0f,1.0f,0.0f)! ^^;
Anyways, you should try not doing this in a single glBegin/end section. If you split triangles from quads it works fine:
gl.glBegin(GL.GL_TRIANGLES); // Drawing Using Triangles gl.glColor3f(1.0f,0.0f,0.0f); // Red gl.glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Front) gl.glColor3f(0.0f,1.0f,0.0f); // Green gl.glVertex3f(-1.0f,-1.0f, 1.0f); // Left Of Triangle (Front) gl.glColor3f(0.0f,0.0f,1.0f); // Blue gl.glVertex3f( 1.0f,-1.0f, 1.0f); // Right Of Triangle (Front) gl.glColor3f(1.0f,0.0f,0.0f); // Red gl.glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Right) gl.glColor3f(0.0f,0.0f,1.0f); // Blue gl.glVertex3f( 1.0f,-1.0f, 1.0f); // Left Of Triangle (Right) gl.glColor3f(0.0f,1.0f,0.0f); // Green gl.glVertex3f( 1.0f,-1.0f, -1.0f); // Right Of Triangle (Right) gl.glColor3f(1.0f,0.0f,0.0f); // Red gl.glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Back) gl.glColor3f(0.0f,1.0f,0.0f); // Green gl.glVertex3f( 1.0f,-1.0f, -1.0f); // Left Of Triangle (Back) gl.glColor3f(0.0f,0.0f,1.0f); // Blue gl.glVertex3f(-1.0f,-1.0f, -1.0f); // Right Of Triangle (Back) gl.glColor3f(1.0f,0.0f,0.0f); // Red gl.glVertex3f( 0.0f, 1.0f, 0.0f); // Top Of Triangle (Left) gl.glColor3f(0.0f,0.0f,1.0f); // Blue gl.glVertex3f(-1.0f,-1.0f,-1.0f); // Left Of Triangle (Left) gl.glColor3f(0.0f,1.0f,0.0f); // Green gl.glVertex3f(-1.0f,-1.0f, 1.0f); // Right Of Triangle (Left) gl.glEnd(); // Finished Drawing The Pyramid gl.glBegin(GL.GL_QUADS); // Drawing Using Quads gl.glColor3f(1.0f, 1.0f, 1.0f); gl.glVertex3f( 1.0f,-1.0f, 1.0f); // Top Right Of The Quad (Bottom) gl.glVertex3f(-1.0f,-1.0f, 1.0f); // Top Left Of The Quad (Bottom) gl.glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Bottom) gl.glVertex3f( 1.0f,-1.0f,-1.0f); gl.glEnd(); // Finished Drawing The Quad
|
|
|
|
|
3
|
Java Game APIs & Engines / JOGL Development / Re: DemoBox demos added!
|
on: 2005-04-10 09:23:12
|
Nope. The exporter is C++ and only runs under Windows. As does Milkshape  I'm working on an example on how to load models + animation from my exportet format. *in java* Good to hear.  I'll have to make a demo game of sorts starting to learn opengl from scratch, and I surmise it would be much easier if I could do it not making every single 3d object from scratch as well, so a modelling tool seems in order. Of course, to make things more complicate, I'm used to work with java, hence the adoption of jogl. ^^;
|
|
|
|
|
5
|
Java Game APIs & Engines / JOGL Development / Re: DemoBox demos added!
|
on: 2005-04-08 15:00:02
|
|
Some things about the demobox...
When switching to or from it, it turns into a cpu hog! What gives?
The Shaded Teapot looks very beautiful. Did you know that you can see the exterior of the pot through the hole of its beak?
[edit: About the milkshape exporter...the readme says "source" but there's but a dll inside the zip...?]
|
|
|
|
|
6
|
Java Game APIs & Engines / JOGL Development / Re: [Newbie] Colouring, Lighting, Texturing
|
on: 2005-04-08 12:13:16
|
As an example of how I don't know the way things work, after enabling GL_COLOR_MATERIAL, lights work and colors show up (if I understand correctly, the material is what determines how a surface reflects lights, and the constant above enables management of such a property in terms of fill color and not just textures?), but I notice the light is a lot brighter everywhere. My guess would be that the pyramid is reflecting light and diffusing it, but I notice that this light is brighter even on the other side of the cube (see image below), so this brightness increase is not directional. If the behaviour before enabling GL_COLOR_MATERIAL is to be considered the default, then I wonder what exactly causes this variation. (this picture *does* have shadows, they just are less evident. Check the right face of the cube) 
|
|
|
|
|
7
|
Java Game APIs & Engines / JOGL Development / Re: [Newbie] Colouring, Lighting, Texturing
|
on: 2005-04-08 11:02:12
|
Why not load models instead? That way it'll be the artists problem  Lot's of free model resources on the internet too. I have some classes to easily load/display models of various format if you're interested. It's just that I'm still learning everything from scratch, so...I don't even know what a model is. ^^; It will probably come in handy for what I have to do, though. If it is not complicated, could you give me a brief explanation, or otherwise point me to one?
|
|
|
|
|
10
|
Games Center / Archived Projects / Re: Star Gauge (formally Exigent), v0.2.1a (update
|
on: 2005-04-07 23:01:19
|
|
It is so fast it almost is too tough to play. Framerate at 75 all the time when running at 1280x960 whether fullscreen or windowed. Very well done. The game mechanics are rough but that's to be expected from an in-progress work, the engine is certainly sound though. Haven't had any problem running it. Sure, I have 1GB of ram, that might help a bit, but still. ^^
Keep up the good work.
|
|
|
|
|
11
|
Java Game APIs & Engines / JOGL Development / [Newbie] Colouring, Lighting, Texturing
|
on: 2005-04-07 22:57:40
|
Greetings again, and thanks for the help provided so far. I come again with some questions, this time concerning interaction between colors, lights and texturing. I've been piling up the various tutorials at NeHe on the framework of the one in the "how to get started with jogl" in this very forum, and so far it's been fine. One problem I've found has come up when mixing textured and untextured polygons. I made the colored pyramid and cube in the solid tutorial, and then decided to texture that same cube. At first, it would work but make the pyramid colored weird. So I thought of disabling the textures when the pyramid was being drawn and reenabling them for the cube, and it worked:  Then I did the lights and filters demo, which adds various filtered textures and, more importantly, lights, to the scene. This time, the trick of enabling and disabling hasn't been enough. If lights are on, it will look like this:  I did put some normals on the pyramid faces to get that reaction to the light (not sure if they're ok, probably wrong) otherwise it'd come out as if lights didn't touch the pyramid, but when I disable the lights, the colors appear just fine (mind that this happens because, as I said, I disable textures when drawing the pyramid and reenable them for the cube):  So, I believe there is some interaction between the textures, the lights and the colors, but I haven't been able to figure out a way to unbundle that. More importantly, I get the feeling that enable-disable isn't good programming, but then again I'm new to all this, so the answer might just be in front of my eyes and I just can't see. What do you make of it? Thanks for your time in advance.
|
|
|
|
|
12
|
Java Game APIs & Engines / JOGL Development / Re: Really Newbie Puzzled by glTranslate
|
on: 2005-03-31 07:59:38
|
Thank you, will do. I already downloaded the webstarted version of your demobox, anyway.  [edit: Yes, it was a matter of perspective, coupled with inexperience. At some point I had both failed to properly init perspective settings and tried to compensate by altering proportions, which had led to invisible and/or misplaced objects. Well, learning one stumble at a time. ^^;]
|
|
|
|
|
13
|
Java Game APIs & Engines / JOGL Development / Really Newbie Puzzled by glTranslate
|
on: 2005-03-31 07:36:53
|
|
(reposted as a new thread because I noticed the "how to get started with jogl" thread was kind of old)
Greetings. As a novice to OpenGL, I humbly come with a bit of confusion in my mind. The example ("how to get started with jogl") worked pretty well for me. Then I went to NeHe's tutorial and I thought I'd include bits of that in this example, and sure enough, coloured triangles and quads were soon spinning on my window. But not everything went ok. The three points of this thread: 1) The usual proportion for windows is 4:3 and so is the one proposed in this example, at 512x384. But that kind of flattens the proportions of the objects, so how does one decouple the dimensions of the window from the ones of the drawing space? 2)NeHe uses a glTranslatef(float,float,float) line to translate (duh) stuff on the drawing space, but if I can't seem to make it work for the Z axis. Take the example in this thread exactly as it is and put a gl.glTranslatef(x,y,z) line before the glcolor. Changes to x and y will show up, but changes to z will be erratic. Between -1.0 and 1.0, it won't change at all, and any other value will make the triangle disappear. Is this something that requires more than the simple inits performed in this example, or is it something jogl-related? (ok, I had forgotten the 3rd point) 3) Have the GL-types been implemented in jogl, or should one use standard java types?
Thanks for your time in advance.
|
|
|
|
|
14
|
Java Game APIs & Engines / JOGL Development / Re: How to: Getting started with JOGL
|
on: 2005-03-30 19:52:27
|
|
Greetings. As a novice to OpenGL, I humbly come with a bit of confusion in my mind.
The example worked pretty well. Then I went to NeHe's tutorial and I thought I'd include bits of that in this example, and sure enough, coloured triangles and quads were soon spinning on my window. But not everything went ok.
The three points of this post:
1) The usual proportion for windows is 4:3 and so is the one proposed in this example, at 512x384. But that kind of flattens the proportions of the objects, so how does one decouple the dimensions of the window from the ones of the drawing space?
2)NeHe uses a glTranslatef(float,float,float) line to translate (duh) stuff on the drawing space, but if I can't seem to make it work for the Z axis. Take the example in this thread exactly as it is and put a gl.glTranslatef(x,y,z) line before the glcolor. Changes to x and y will show up, but changes to z will be erratic. Between -1.0 and 1.0, it won't change at all, and any other value will make the triangle disappear. Is this something that requires more than the simple inits performed in this example, or is it something jogl-related?
(ok, I had forgotten the 3rd point)
3) Have the GL-types been implemented in jogl, or should one use standard java types?
Thanks for your time in advance.
Immano
|
|
|
|
|