Show Posts
|
|
Pages: [1] 2 3 ... 5
|
|
6
|
Java Game APIs & Engines / OpenGL Development / Re: Modelview and Projection Matrix
|
on: 2003-11-19 11:10:57
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| [float[] params2=new float[16]; FloatBuffer params = ByteBuffer.allocateDirect(64).order(ByteOrder.nativeOrder()).asFloatBuffer(); gl.getFloatv(GL.MODELVIEW_MATRIX, Sys.getDirectBufferAddress(params)); for(int r=0; r<16; r++) { params2[r]=params.get(r); System.out.println(params2[r]);
} BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); try { stdin.readLine(); } catch(IOException e){ } params.clear(); Matrix4f modelview = new Matrix4f(params2); modelview.transpose(modelview); gl.getFloatv(GL.PROJECTION_MATRIX, Sys.getDirectBufferAddress(params)); for(int r=0; r<16; r++) { params2[r]=params.get(r); System.out.println(params2[r]); } try { stdin.readLine(); } catch(IOException e){ } params.clear(); |
I'll start on that as soon as I get this to work. This is in drawGLScene. The first time, it works fine. params is filled, and I think it more or less works. After that, params2 is always set to zero. This occurs with our without the params.clear calls made. Anyone know why this would happen? Thanks. -Nick
|
|
|
|
|
9
|
Java Game APIs & Engines / OpenGL Development / Modelview and Projection Matrix
|
on: 2003-11-18 19:17:35
|
I'm trying to get the modelview and projection matrices. Normally, I'd do something along the lines of 1 2 3
| float params[] = new float[16]; gl.getFloatv(GL.MODELVIEW_MATRIX, params); gl.getFloatv(GL.PROJECTION_MATRIX, params); |
However, it wants params to be an integer. How should I do this? I want the final values to be in an array of floats. Thanks. -Nick Edit: I'm using LWJGL 0.6
|
|
|
|
|
15
|
Java Game APIs & Engines / JOGL Development / glu cylinders
|
on: 2003-09-28 00:47:36
|
Here's my code: 1 2 3 4 5 6 7 8 9
| public void drawStraightPipe(GLDrawable glDrawable, int x, int y) { final GL gl=glDrawable.getGL(); final GLU glu=glDrawable.getGLU(); gl.glLoadIdentity(); gl.glTranslatef((float)(x*10.0f), (float)(y*10.0f), 0.0f); glu.gluCylinder(new GLUquadric(), 5.0, 5.0, 10.0, 10, 1);
} |
It draws absolutely nothing. Am I missing something? Thanks! Edit: Braces (but they're still messed up)
|
|
|
|
|
17
|
Java Game APIs & Engines / JOGL Development / Re: problems with nehe's creating a window lesson
|
on: 2003-09-27 23:10:14
|
I'm using 1.4.2 and there's a system.exit call. Here's the code that should make it exit: 1 2 3 4 5 6 7
| public void keyTyped(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { System.exit(0); } } |
If you want the full program's code, here it is: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
import java.awt.*; import java.awt.event.*;
import net.java.games.jogl.*;
public class Pipes { static class Renderer implements GLEventListener, KeyListener { public void display(GLDrawable gLDrawable) { final GL gl = gLDrawable.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity(); gl.glTranslatef(-1.5f, 0.0f, -6.0f); gl.glBegin(GL.GL_TRIANGLES); gl.glVertex3f( 0.0f, 2.0f, 0.0f); gl.glVertex3f(-1.0f,-1.0f, 0.0f); gl.glVertex3f( 1.0f,-1.0f, 0.0f); gl.glEnd(); gl.glTranslatef(3.0f, 0.0f, 0.0f); gl.glBegin(GL.GL_QUADS); gl.glVertex3f(-1.0f, 1.0f, 0.0f); gl.glVertex3f( 1.0f, 1.0f, 0.0f); gl.glVertex3f( 1.0f,-1.0f, 0.0f); gl.glVertex3f(-1.0f,-1.0f, 0.0f); gl.glEnd(); gl.glFlush(); }
public void displayChanged(GLDrawable gLDrawable, boolean modeChanged, boolean deviceChanged) {
}
public void init(GLDrawable gLDrawable) { final GL gl = gLDrawable.getGL(); gl.glShadeModel(GL.GL_SMOOTH); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.5f); gLDrawable.addKeyListener(this); }
public void reshape(GLDrawable gLDrawable, int x, int y, int width, int height) { final GL gl = gLDrawable.getGL(); final GLU glu = gLDrawable.getGLU();
if (height <= 0) height = 1; final float h = (float)width / (float)height; gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(45.0f, h, 1.0, 20.0); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); }
public void keyPressed(KeyEvent e) {}
public void keyReleased(KeyEvent e) {}
public void keyTyped(KeyEvent e) { if (e.getKeyChar() == KeyEvent.VK_ESCAPE) { System.exit(0); } } }
public static void main(String[] args) { Frame frame = new Frame("Lesson 1: An OpenGL Window"); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); canvas.addGLEventListener(new Renderer()); frame.add(canvas); frame.setSize(640, 480); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); frame.show(); } }
|
|
|
|
|
|
20
|
Java Game APIs & Engines / OpenGL Development / Failed to Set Display Mode
|
on: 2003-09-18 19:23:19
|
|
I'm using LWJGL .6. Any reason on why I would get the "failed to set display mode error"? It worked fine a week ago. The only change I've made to my computer is installed the latest nvidia drivers. I have the Gainward GForceFX5600 w/ 256 MB.
Thanks!
-Nick
|
|
|
|
|
22
|
Game Development / Game Play & Game Design / Re: What can we learn from Neopets?
|
on: 2003-09-01 03:26:46
|
|
Neopets is cute. I used to play it. A female friend got me into it. But the downside to me (a 19, almost 20 year old male, so the typical gamer) is that there wasn't much replay. And with these millions of gamers all viewing the exact same web page, things are impossible to gain. Like take their "money tree" for example. You click on a money bag, and if it's still there, you get it. But there are millions of people trying to get it. I also didn't find the games that interesting. Not much replay.
However, my little sister continues to play it. So I guess Kevglass has figured it out. Make it cute, make it free. You'll at least attract the young females.
|
|
|
|
|
23
|
Discussions / Miscellaneous Topics / Re: Brace styles
|
on: 2003-08-19 04:51:31
|
come on people, #1 is the way to go....#2 reminds me of a double negative.
public void foo() { //blah }
is readable, but the braces do not have to be lined up because in
public void foo(){ //blah }
the exact start of the function already lines up with the exact end, and doesnt this just make sense? i'm sure you all realize this but it's more symmetrical to have ONE start line and ONE end line.
symbols such as { && ||, etc really shouldnt start their own lines, just as the words "including", "and", and "or" do not properly begin sentences in English.
thats why I prefer
public void foo(args){ if(long boolean statement one && long boolean statement two){ } else if(boolean){ } }
over this monstrosity:
public void foo(args) { if(long boolean statement one && long boolean statement two) { } else if(boolean) { } }
Quiet! Nexus is one of the guys working on the project. :P
|
|
|
|
|
24
|
Games Center / Archived Projects / Re: So.. who's here who's actually going professio
|
on: 2003-08-01 17:51:00
|
Well I'm about in the same bout as cas (so your not entirely alone). I'm working pretty much fulltime developing our java based game but do odd jobs for cash when needed. Our game was supposed to be demo'ed at the JavaOne conference this year and I was suppose to participate in a round table discussion but finance problems and conflict with a release of our last beta round prevented it. Our game is pretty much geared as a web based, strategy/war simulation killer. If you have ever played games like Utopia, once we get our game released there will be no reason why anyone would want to play webbased strat games again. Everything is graphical based in our game and our server bandwidth problems are greatly reduced with our model vs web based games (means more players can play on each server). Not to mention our game includes a rts battle engine (ala warcraft 2 style) where your army can battle any other player in the world, and are starting to work on a jogl port. I seriously hope that sometime within the next 6 months(planned game release) we will start making a lot more money. I think we have a good business strategy (ad revenue and subscriptions) and we are already producing revenue though we haven't started selling subscriptions to our MMOG. We actually need one more beta round (2 months) before we will release our game. Those who play our game (about 150 active players so far) really enjoy it but we have the problem that the game becomes a ton more fun if we had 1500 players (new realms open up, not always battling the same kingdoms/players). Because of this issue we are growing slowly because we are only gaining a few more players then we lose each week. So some type of production release would really help our game. btw you can check out our game at http://abandonedcastle.comWow, the game looks really good. Too bad I'm about to leave town. But I'll be sure to try it out when I get back in two weeks.
|
|
|
|
|
27
|
Games Center / Archived Projects / Re: So.. who's here who's actually going professio
|
on: 2003-07-31 17:48:33
|
I wouldn't expect much that soon. Here in the UK the specialise games-industry recruitment agencies normally won't even put developers with java skills on their books, let alone put them forward for interviews.
...unless the individual is willing to have references to "java" removed from their CV, and has C++ instead.
Or they're only looking at new-graduate positions. Basically, java = no experience at all. Even when their customers tell them they specifically need java developers, they have an ingrained anti-java slant. Whether this is because of their own biases, or because so few of their customers will accept it, I have no idea.
Actually, it may even have something to do with some of their customers getting burnt with so-called "java developers" who were incompetent at any language, and the company then told the agency "no more java developers, even if they claim they can learn C++ quickly".
Shrug. I know plenty of people who got jobs with games companies through java skill and experience, but the agencies wouldn't touch them. I know plenty who've been refused job interviews until they replaced java with something else. If you go to companies directly they may recognise the value of java.
Well, good thing I already know C++ then. Thank you college board! I will change things from the inside. Java will control the world! MWA HA HA HA HA! 
|
|
|
|
|
28
|
Games Center / Archived Projects / Re: i have the concept of a new kind of game
|
on: 2003-07-31 17:35:42
|
You may want to look at the best sellers list for the PC and consoles. While games like Unreal Tournament get a lot of press, games like The Sims sell a metric ass-load more units. Pick your battles. If you've got a good game it will show - plus if you start looking at the trends, the older market is actually starting to steer away from games that have 9000 hours of gameplay in them because they can't invest that much time in a game. Last research study I saw on the gaming market still said that games like Solitaire still dominated the 'hours played' segment because they are easy to get into and can be played in spare time... but perhaps I've said too much  Games like the Sims are few and far between. The market is cluttered with eye candy and glitter. I no longer play first person shooters. You ask why not? Because honestly, I haven't seen significant gameplay advances since Cyclone for Win95! They just change the environment and graphics. And when games like the Sims do well, someone will come up with a horrible game (or chatroom) called The Sims Online. The music industry analogy is correct. Why try something new when you have something that's been successful 5 times in a row? Just produce that again, but add better graphics! I guess that's what happens when they realize how much money they can make in the video game industry. And I'm not even going to start on most RPGs (FF series in particular)...
|
|
|
|
|
29
|
Java Game APIs & Engines / OpenGL Development / Re: Confusing API
|
on: 2003-07-31 16:29:05
|
|
Have the creators of LWJGL considered writing tutorials that are specific to LWJGL? I know there are plenty of OpenGL tutorials out there, but it would really be helpful if the tutorials are taught in the language that the user wants to use it in, in this case Java. I think newbies (and I still do) would love to be able to skip all the creating windows crap, and LWJGL simplifies it.
And if not, I'd like to start creating a OpenGL tutorial specific to LWJGL/Java. Would anyone like to join me in writing this?
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|