Show Posts
|
|
Pages: [1] 2 3 ... 13
|
|
1
|
Java Game APIs & Engines / JOGL Development / Re: Java FloatBuffers don't always translate nicely to C API
|
on: 2007-05-07 11:20:32
|
My problem is that if I interleave a FloatBuffer in T2F_N3F_V3F (texture, normal, vertex), and I don't use a VBO, I need to jump through hoops to get the offset into the FloatBuffer. I could write something like this: 1 2 3 4 5 6 7 8 9
| FloatBuffer interleavedBuffer = generateT2F_N3F_V3FInterleavedBuffer(); gl.glTexCoordPointer(2, GL.GL_FLOAT, 8 * BufferUtil.SIZEOF_FLOAT, interleavedBuffer); interleavedBuffer.position(2); FloatBuffer normalSlice = interleavedBuffer.slice(); gl.glNormalPointer(GL.GL_FLOAT, 8 * BufferUtil.SIZEOF_FLOAT, normalSlice); group.interleavedAnimatedArray.position(5); FloatBuffer vertexSlice = interleavedBuffer.slice(); gl.glVertexPointer(3, GL.GL_FLOAT, 8 * BufferUtil.SIZEOF_FLOAT, vertexSlice); interleavedBuffer.position(0); |
There's no need to do the slicing since the gl...Pointer methods already take the current position of a buffer into account.
|
|
|
|
|
8
|
Game Development / Performance Tuning / Re: float[] view of direct FloatBuffer + mapped objects (finally!)
|
on: 2007-01-10 16:47:08
|
I'd really like to see the code behind this, it sounds like a neat hack.
I'll second that. Perhaps you can pin the objects in JNI using getCritical thingies?
The JNI spec says you're only allowed to use get*Critical for small bits of code. I don't think you can pin objects in memory for an extended period of time. The spec also mentions that these methods don't necessarily pin the object. You still might get a copy.
|
|
|
|
|
10
|
Game Development / Shared Code / Re: Point in Triangle Test
|
on: 2006-12-19 10:26:04
|
|
If you have a guaranteed winding you could use cross products. Given a point p and a triangle a,b,c that is wound clockwise ab x ap, bc x bp and ca x cp all have to be greater or equal to zero in order for the point to lie inside the triangle.
|
|
|
|
|
11
|
Java Game APIs & Engines / Tools Discussion / Re: Game Studio (GS)
|
on: 2006-12-18 08:06:00
|
|
Since I don't work in the games industry, I don't really know how people work in that sector on a day to day basis, but from my point of view it seems that a lot of existing tools already cover the features you're asking for. Using basic stuff like a version control system and some build system, an instant messenger or plain old telephones, and existing tools such as blender and the gimp it seems like you should be able to set up a pretty decent working environment. I don't see why you would want to put so much time (it really sounds like a huge project) in basically reinventing stuff that already exists. In other words, do you really think this kind of 'integrate everything' tool is commercially viable?
|
|
|
|
|
13
|
Java Game APIs & Engines / JOGL Development / Re: OpenGL integration in Java SE6?
|
on: 2006-12-13 14:06:41
|
James Gosling is refering to the possibility to integrate jogl and java2d. One of the java2d implementations (not the default one) in jse6 is based on opengl. It has been designed so that you can take the opengl rendering context of a component and render on it using both java2d and jogl. In other words you can easily combine 2d and 3d rendering in a single component without having to render to intermediate images. See the Java2D/JOGL Interoperability thread for more detailed info.
|
|
|
|
|
14
|
Discussions / Miscellaneous Topics / Re: books u read to learn , and read for pastime
|
on: 2006-12-13 09:54:53
|
Whatever I can get my hands on that seems relevant to my work. In college I worked my way through books on OSes, compiler construction, AI, hardware architecture, programming alngauges, software design, user inteface design, computer graphics, ... Currently on my desk (work related): - The OpenGL programming guide (red book)
- The OpenGL shading language book (orange book)
- Designing interfaces by Jeniffer Tidwell
- Concurrent Programming in Java by Doug Lea
- Mastering the JFC (The big Swing reference book)
- Artifical Intelligence - A Modern Approach by Russel and Norvig
- Visual Explanations by Edward Tufte
I'm not going to pretend I've read all of these back to front, but I have gotten tons of useful information out of each one. In my spare time I'm currently reading 'The design of everyday things' by Don Norman. Next on the to read pile is 'The Humane Interface' by Jef Raskin.
|
|
|
|
|
15
|
Game Development / Newbie & Debugging Questions / Re: AffineTransform...
|
on: 2006-12-13 09:44:38
|
Each Graphics2D object has a current transformation. By default this is an identity transformation, i.e. do nothing. This transformation is represented by an instance of AffineTransform. You can modify this transformation implictly using methods like Graphics2D#scale, Graphics2D#translate, Graphics2D#shear, ... or explicitly set a transformation using Graphics2D#setTransform. The problem in your code is that you do 1 2 3
| AffineTransform transform = new AffineTransform(); transform.setTransform(identity); transform.scale(this.zoomLevel, this.zoomLevel); |
but after that you don't do anything with the transformation. Depending on what you're trying to exactly you'll have to pass this transformation to the Graphics2D object somewhere using one of the methods I mentioned above. If you want some more info on the mathematics behind all this stuff Martin Baker's math site is a pretty good starting point. I would recommend you make sure you thoroughly understand this stuff. It will all make a lot more sense then...
|
|
|
|
|
18
|
Game Development / Shared Code / Re: JSquish - DXT Compression Library
|
on: 2006-12-07 09:01:29
|
Shouldn't 1 2
| int b1 = packed[pOffset + 0 + cOffset * 2] & 0xff; int b2 = packed[pOffset + 1 + cOffset * 2] & 0xff; |
be 1 2
| int b1 = packed[pOffset + 0] & 0xff; int b2 = packed[pOffset + 1] & 0xff; |
? If not, why do you need to add cOffset * 2 to the packed offset?
|
|
|
|
|
19
|
Game Development / Newbie & Debugging Questions / Re: Some IO Help Needed, on a project..
|
on: 2006-12-05 11:22:13
|
|
You can access files that are located in the classpath using a ClassLoader. More specifically you can use the methods ClassLoader#getSystemResourceAsStream or ClassLoader#getResourceAsStream. As far as I know j2se doesn't provide any API to update an existing jar file. It's pretty straightforward to create a new one though using a JarOutputStream.
|
|
|
|
|
22
|
Java Game APIs & Engines / JOGL Development / Re: Textures and BufferedImage
|
on: 2006-11-30 10:31:22
|
|
Out of curiosity, I had a look at the TextureData code. It seems that for 4BYTE_ABGR it goes through the slowest code path (createFromCustom). You have to do something with the data since OpenGL only supports RGBA and BGRA, not ABGR, but you can do this conversion much faster than via the image apis. I did this by grabbing the bytes directly from the DataBuffer and swizzling them in place.
|
|
|
|
|
25
|
Java Game APIs & Engines / JOGL Development / Re: Swing components above OpenGL window dont update.
|
on: 2006-11-22 11:53:21
|
|
I've noticed similar issues in my application. I tried tracking down the cause of this and as far as I could tell this was (at least partially) due to the prioritizing of events in java.awt.EventQueue. You'll see there that heavyweight paint events get the lowest possible priority. My hunch was that when a new popup menu or tooltip (using heavyweights for both) triggered some event that got low priority and due to my opengl view hogging the EDT, that these events didn't get much chance to actually be processed. After optimizing my rendering code, the delay for the popups and tooltips to actually draw improved considerably. This also seems to point in the direction that some event isn't being processed in a timely fashion. I don't have exact knowledge of how all the different parts (native side, java side, popup menus, ...) in awt interact though, so I might have drawn a wrong conclusion. Hopefully one of the awt engineers can shed some light on this?
|
|
|
|
|
28
|
Java Game APIs & Engines / JOGL Development / Re: Java implementation of FreeType
|
on: 2006-11-03 18:29:53
|
|
I've only implemented the bitmap font technique described in the red book. It's pretty straightforward using BufferedImage and Font. Make an image of type BufferedImage.TYPE_BYTE_BINARY, render the character you want to it and read back the contents of the data buffer. That data can then be used as input for glBitmap. This gives you crisp, non-scaling text.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|