Show Posts
|
|
Pages: [1] 2
|
|
2
|
Java Game APIs & Engines / OpenGL Development / OpenAL Problems
|
on: 2004-03-15 10:33:21
|
|
Howzit
When I try to create an OpenAL instance I get this:
-----------
org.lwjgl.openal.OpenALException: Could not load openal library. at org.lwjgl.openal.BaseAL.nCreate(Native Method)
at org.lwjgl.openal.BaseAL.create(Unknown Source) at org.lwjgl.openal.AL.create(Unknown Source) at OpenALCreationTest.alInitialize(OpenALCreationTest.java:57) at OpenALCreationTest.execute(OpenALCreationTest.java:101) at OpenALCreationTest.main(OpenALCreationTest.java:219)
-----------
The odd thing is that I am including the library in my path. OpenGL works fine.
|
|
|
|
|
3
|
Java Game APIs & Engines / OpenGL Development / Mouse and Screen Bounds
|
on: 2004-01-28 11:53:48
|
|
Howzit
How do I keep the mouse within the bounds of the screen when I am in full screen.
What I've done is attached a image onto the co-ordinates of the mouse so I can see where it is. But if I carry on moving the mouse say for example left it goes out of the screen. It doesn't just say at the edge.
How do I fix this.
|
|
|
|
|
5
|
Java Game APIs & Engines / OpenGL Development / Scrolling
|
on: 2004-01-20 04:46:44
|
|
Howzit
What is the best way to do scrolling?
At the moment I use glTranslatef and it works fine, but when I put another object on the screen it doesn't scroll. So what I did then was add/substract the same amount that the ground moves from the model. That works but it looks like the model is moving on the ground.
I'm using
gluPerspective(45.0f, (float) Display.getWidth() / (float) Display.getHeight(), 1.0f, 10000.0f)
for the default view
|
|
|
|
|
6
|
Java Game APIs & Engines / OpenGL Development / Rotation Schemes
|
on: 2004-01-19 04:06:21
|
|
Howzit
I've got a 3D model that I've imported and it's cool. But now I need to rotate it when I press the relevant arrow key.
I've written some methods to rotate it using glRotatef but it doesn't work perfectly. I need it to be like like a character in Warcraft III. Those characters turn and face what ever position you click. The only difference with mine is that it's keyboard controlled.
What would be the best way to do this?
Shot
|
|
|
|
|
7
|
Java Game APIs & Engines / OpenGL Development / gluPerspective & gluOrtho2D
|
on: 2004-01-16 10:12:50
|
|
Howzit
I wrote a method that accepts a width and a height, which then goes and paints quads on the screen at the revelant places. I did this using gluOrtho2D and glTranslatef and it works perfectly.
Then I change to gluPerspective and I draw a small quad in the center of the screen also with glTranslatef.
When I press the arrow keys I increase/decrease the x or y values as needed to get the background to move around.
The problem comes in when I press the arrow keys. The small block in the middel of the screen dissappears. The background is still there though.
What can I do?
|
|
|
|
|
8
|
Java Game APIs & Engines / OpenGL Development / Re: Please explain Milkshape3D
|
on: 2004-01-16 03:55:22
|
|
I managed to figure it out. It only works for me if the texture width and height are divisible by the power of 2. Like 256, 256; 128, 128
I think you might need to make the texture an Indexed image, but I'm not sure, I did it anyway. Photoshop has that ability.
|
|
|
|
|
9
|
Java Game APIs & Engines / OpenGL Development / Please explain Milkshape3D
|
on: 2004-01-15 12:00:18
|
|
Can you believe it, I'm so dumb, I thought it was called MilkShake3D. Anyway...
I got the Milkshape loader and with it came a model which worked perfectly when I imported it. Then I decided to be brave and make my own model. I appiled a texture which was all fine but when I imported it, there was no texture.
Why could that be?
I'm exporting to a *.txt file
The texture and the model were in the same directory.
|
|
|
|
|
11
|
Java Game APIs & Engines / OpenGL Development / Re: Tiling Textures
|
on: 2004-01-15 10:11:44
|
|
Let me tell you what I want to do.
I'm writing a game that has a scrolling background but the background is different, i.e. think of StarCraft
There was a post a while ago that asked if he should import a huge image or smaller ones.
If I import a huge image it's going to lag my PC because it will will be about 16000 pixels each way, x, y. If I can make smaller images say of 1024 pixels and then place them where I need them there won't be such a lot of drain.
Otherwise I have to keep track of where the different quads are.
|
|
|
|
|
16
|
Java Game APIs & Engines / OpenGL Development / Perspective
|
on: 2004-01-13 07:49:22
|
|
Howzit I've started to write a FPS, all I've got at the moment is a tunnel of which I can go forward, back, left right and I can jump. Three things I'm not quite sure about: 1: I move backwards and forwards by calling glTranslatef and I decrease/increase the Z-axis depending on whether I'm going forwards or backwards. Is this the right way to do it or is there a better way? 2: How do I turn around, like do a 360' turn on the spot.
3. When I import a 3D model, how do I change the perspective of the model without changing the size?
If I use GL.glLookAt(); I can get the right size, but then the model is in the distance. If I bring it closer it gets bigger. How do I keep the size the same?
|
|
|
|
|
18
|
Game Development / Game Mechanics / Perspective
|
on: 2004-01-12 07:06:46
|
|
Howzit
I've started to write a FPS, all I've got at the moment is a tunnel of which I can go forward, back, left right and I can jump.
Two things I'm not quite sure about:
1: I move backwards and forwards by calling glTranslatef and I decrease/increase the Z-axis depending on whether I'm going forwards or backwards.
Is this the right way to do it or is there a better way?
2: How do I turn around, like do a 360' turn on the spot.
|
|
|
|
|
19
|
Java Game APIs & Engines / OpenGL Development / Re: Is there any way to draw images from files wit
|
on: 2004-01-12 06:54:57
|
|
private final static int loadTexture(String path) { Image image = (new javax.swing.ImageIcon(path)).getImage(); // Extract The Image BufferedImage tex = new BufferedImage(image.getWidth(null), image.getHeight(null), BufferedImage.TYPE_3BYTE_BGR); Graphics2D g = (Graphics2D) tex.getGraphics(); g.drawImage(image, null, null); g.dispose(); // Flip Image AffineTransform tx = AffineTransform.getScaleInstance(1, -1); tx.translate(0, -image.getHeight(null)); AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR); tex = op.filter(tex, null); // Put Image In Memory ByteBuffer scratch = ByteBuffer.allocateDirect(4 * tex.getWidth() * tex.getHeight()); byte data[] = (byte[]) tex.getRaster().getDataElements(0, 0, tex.getWidth(), tex.getHeight(), null); scratch.clear(); scratch.put(data); scratch.rewind(); // Create A IntBuffer For Image Address In Memory IntBuffer buf = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer();
GL.glGenTextures(buf); // Create Texture In OpenGL GL.glBindTexture(GL.GL_TEXTURE_2D, buf.get(0)); // Typical Texture Generation Using Data From The Image // Linear Filtering GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); GL.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR); // Generate The Texture GL.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, tex.getWidth(), tex.getHeight(), 0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, scratch); return buf.get(0); // Return Image Address In Memory }
I'm not sure what the layout will look like because I pasted this.
Ok.. This works for me. The only thing is that the image/texture HAS to be 256x256 pixels
The way to use it: define a variable of type int int num = 0; when you ini* openGL call the method num = loadTexture("path");
Then you can use that 'num' to bind the texture
|
|
|
|
|
20
|
Java Game APIs & Engines / OpenGL Development / Re: 3dsLoader Details
|
on: 2004-01-12 03:56:07
|
|
I managed to import the model. I was importing in 3D space so what I did was divide every vertex by 10 which made the distance between the points shorter.
I'm not sure if I've got the full API because some of the methods that are in the javadoc are not in the classes.
The other problem is that it's not importing the textures.
|
|
|
|
|
22
|
Java Game APIs & Engines / OpenGL Development / Blending
|
on: 2004-01-11 06:04:58
|
|
Howzit
How do I load a texture say for example a gun, all I want is the gun and not the rest of the parts that just fill the image. I need to map the gun over the other images.
Is there a way to do this in OpenGL or do I need to do it manually?
Shot
|
|
|
|
|
23
|
Java Game APIs & Engines / OpenGL Development / Milkshake3D
|
on: 2004-01-10 16:39:59
|
|
Howzit
How do you import Milkshake3D models LWJGL. I'v got a Milkshake3DLoader but it's for Java3D.
Where can I get one for LWJGL and how do I implement it? Where can I get code samples?
Shot
|
|
|
|
|
30
|
Java Game APIs & Engines / OpenGL Development / Re: ByteBuffer
|
on: 2004-01-09 04:12:22
|
|
Ok.
Are you using an Image or BufferedImage, because Image does not have a method called getRaster().
I used a similar method a while ago to set my cursor and the image came out all choppy. How do you use the normal cursor?
Shot
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|