Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2
1  Java Game APIs & Engines / OpenGL Development / Playing AVI files on: 2004-03-19 03:31:21
Howzit

How do I play AVI files/movies in LWJGL?

Shot
2  Java Game APIs & Engines / OpenGL Development / OpenAL Problems on: 2004-03-15 09: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 10: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.
4  Java Game APIs & Engines / OpenGL Development / OpenAL on: 2004-01-26 08:30:33
Howzit

How do I do sound using OpenAL? Where can I get tutorials that use it in LWJGL?

Shot
5  Java Game APIs & Engines / OpenGL Development / Scrolling on: 2004-01-20 03: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 03: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 09: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 02: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 11: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.
10  Java Game APIs & Engines / OpenGL Development / Re: Tiling Textures on: 2004-01-15 09:55:19
I'm using glPerspective.
11  Java Game APIs & Engines / OpenGL Development / Re: Tiling Textures on: 2004-01-15 09: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.

12  Java Game APIs & Engines / OpenGL Development / Re: Tiling Textures on: 2004-01-15 06:56:56
That's what I want to do. How do I do that?
13  Java Game APIs & Engines / OpenGL Development / Re: Tiling Textures on: 2004-01-15 06:41:02
I want to put them on the same quad.
14  Java Game APIs & Engines / OpenGL Development / Tiling Textures on: 2004-01-15 06:06:11
Howzit

Say I have 4 textures and I have a quad. What I want to do is put all 4 textures on the same quad at different locations, so it will look like one big picture. How do I do that?

Shot
15  Java Game APIs & Engines / OpenGL Development / 3D Model Conversions on: 2004-01-13 07:05:26
Howzit

Where can I get a program that can export 3D models into the same ascii format that Milkshake 3D does.

It should also be able to import a number of file formats.

Shot

16  Java Game APIs & Engines / OpenGL Development / Perspective on: 2004-01-13 06: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?
17  Java Game APIs & Engines / OpenGL Development / Re: Is there any way to draw images from files wit on: 2004-01-12 06:42:55
Cool, I didn't know that. Thanks for the correction.
18  Game Development / Game Mechanics / Perspective on: 2004-01-12 06: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 05: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 02: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.
21  Java Game APIs & Engines / OpenGL Development / Re: Blending on: 2004-01-12 02:52:54
A flat image
22  Java Game APIs & Engines / OpenGL Development / Blending on: 2004-01-11 05: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 15: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
24  Java Game APIs & Engines / OpenGL Development / Re: 3dsLoader Details on: 2004-01-10 15:19:31
Ok cool, it worked, but I had to go back on the Z -axis to -210 and accross on the X-axis to 50 before I could see anything.

Why is that?
25  Java Game APIs & Engines / OpenGL Development / 3dsLoader Details on: 2004-01-10 09:21:49
Howzit

I got the general 3dsLoader and it work fine but how the hell do you implement it. I've looked at some other C++ tutorials but it's quite different.

Code samples would be appreciated.


Shot.
26  Java Game APIs & Engines / OpenGL Development / LWJGL: WHY? on: 2004-01-09 10:15:03
In all the other Java Gaming API's everything is much easier. Why doesn't LWJGL have loaders and stuff like that?
27  Java Game APIs & Engines / OpenGL Development / Model Import on: 2004-01-09 10:02:44
Howzit

How do you import a 3D model into LWJGL. Preferably with a *.3ds format but it can be anything just so I can get the concept.

Shot
28  Java Game APIs & Engines / OpenGL Development / Mouse on: 2004-01-09 07:59:21
Howzit

How do I get the location of the Mouse when you click it?
I tried Mouse.dx but it didn't really work.

Shot
29  Java Game APIs & Engines / OpenGL Development / Sample Games on: 2004-01-09 03:31:50
Howzit

Where can I downlaod small sample games or demos that have been written in Java using LWJGL?

Also is there a site where I can get code samples?
30  Java Game APIs & Engines / OpenGL Development / Re: ByteBuffer on: 2004-01-09 03: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
Pages: [1] 2
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

toopeicgaming1999 (123 views)
2014-11-26 15:22:04

toopeicgaming1999 (113 views)
2014-11-26 15:20:36

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!