• Content count

  • Joined

  • Last visited

Community Reputation

128 Neutral

About Lex224

  • Rank

Personal Information

  1. Game genres, what do you want to develop?

    I'd love to make a sandbox type game, basically because it would combines so many different things that I'd have to work hard to complete, and could always be added to. That's the beauty of a sandbox game!
  2. Camera and model frame issues

    OK, disregard this. I doubt anybody else will have this same issue, but if they do, all I did was change where I put the SetOrigin from inside the RenderScene function, to the SetupRC function. Silly me.
  3. Camera and model frame issues

    OK, I've stripped the project down to just some simple geometry. I now have a floor and a cylinder object which should be controllable. Again, when I set the cylinder's origin, it's unable to move, yet when I comment out it's origin, it can move. I need to set it's origin in front of the camera so that I can see it, so this is a problem. Here is the stripped down code: [CODE] // Based on SphereWorld4 #include <GLTools.h> #include <GLShaderManager.h> #include <GLFrustum.h> #include <GLBatch.h> #include <GLFrame.h> #include <GLMatrixStack.h> #include <GLGeometryTransform.h> #include <StopWatch.h> #include <math.h> #include <stdio.h> //#ifdef __APPLE__ //#include <glut/glut.h> //#else #define FREEGLUT_STATIC #include <GL/glut.h> //#endif #define NUM_SPHERES 50 GLFrame spheres[NUM_SPHERES]; GLShaderManager shaderManager; // Shader Manager GLMatrixStack modelViewMatrix; // Modelview Matrix GLMatrixStack projectionMatrix; // Projection Matrix GLFrustum viewFrustum; // View Frustum GLGeometryTransform transformPipeline; // Geometry Transform Pipeline GLBatch floorBatch; GLFrame cameraFrame; GLTriangleBatch cylinderBatch; GLFrame cylinderFrame; ////////////////////////////////////////////////////////////////// // This function does any needed initialization on the rendering // context. void SetupRC() { // Initialze Shader Manager shaderManager.InitializeStockShaders(); glEnable(GL_DEPTH_TEST); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // This makes a cylinder gltMakeCylinder(cylinderBatch, 0.1f, 0.0f, 0.4f, 24, 6); // Floor floorBatch.Begin(GL_LINES, 324); for(GLfloat x = -20.0; x <= 20.0f; x+= 0.5) { floorBatch.Vertex3f(x, -0.55f, 20.0f); floorBatch.Vertex3f(x, -0.55f, -20.0f); floorBatch.Vertex3f(20.0f, -0.55f, x); floorBatch.Vertex3f(-20.0f, -0.55f, x); } floorBatch.End(); } /////////////////////////////////////////////////// // Screen changes size or is initialized void ChangeSize(int nWidth, int nHeight) { glViewport(0, 0, nWidth, nHeight); // Create the projection matrix, and load it on the projection matrix stack viewFrustum.SetPerspective(35.0f, float(nWidth)/float(nHeight), 1.0f, 100.0f); projectionMatrix.LoadMatrix(viewFrustum.GetProjectionMatrix()); // Set the transformation pipeline to use the two matrix stacks transformPipeline.SetMatrixStacks(modelViewMatrix, projectionMatrix); } // Called to draw scene void RenderScene(void) { // Color values static GLfloat vFloorColor[] = { 0.0f, 1.0f, 0.0f, 1.0f}; static GLfloat vCylColor[] = { 0.2f, 1.0f, 1.0f, 1.0f }; // Clear the color and depth buffers glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Save the current modelview matrix (the identity matrix) modelViewMatrix.PushMatrix(); M3DMatrix44f mCamera; cameraFrame.GetCameraMatrix(mCamera); modelViewMatrix.PushMatrix(mCamera); // Transform the light position into eye coordinates M3DVector4f vLightPos = { 0.0f, 10.0f, 5.0f, 1.0f }; M3DVector4f vLightEyePos; m3dTransformVector4(vLightEyePos, vLightPos, mCamera); // Draw the ground shaderManager.UseStockShader(GLT_SHADER_FLAT, transformPipeline.GetModelViewProjectionMatrix(), vFloorColor); floorBatch.Draw(); // Draw cylinder modelViewMatrix.PushMatrix(); modelViewMatrix.MultMatrix(cylinderFrame); shaderManager.UseStockShader(GLT_SHADER_POINT_LIGHT_DIFF, transformPipeline.GetModelViewMatrix(), transformPipeline.GetProjectionMatrix(), vLightEyePos, vCylColor); cylinderFrame.SetOrigin(0.0f, 0.0f, -2.0f); cylinderFrame.SetForwardVector(0.0f, 0.0f, 1.0f); cylinderBatch.Draw(); modelViewMatrix.PopMatrix(); // Restore the previous modleview matrix (the identity matrix) modelViewMatrix.PopMatrix(); modelViewMatrix.PopMatrix(); // Do the buffer Swap glutSwapBuffers(); // Tell GLUT to do it again glutPostRedisplay(); } // Respond to arrow keys by moving the camera frame of reference void SpecialKeys(int key, int x, int y) { float linear = 0.1f; float angular = float(m3dDegToRad(5.0f)); if(key == GLUT_KEY_UP) cameraFrame.MoveForward(linear); if(key == GLUT_KEY_DOWN) cameraFrame.MoveForward(-linear); if(key == GLUT_KEY_LEFT) cameraFrame.RotateWorld(angular, 0.0f, 1.0f, 0.0f); if(key == GLUT_KEY_RIGHT) cameraFrame.RotateWorld(-angular, 0.0f, 1.0f, 0.0f); } void Keyboard(unsigned char key, int x, int y) { switch(key) { case('w'): { cylinderFrame.MoveForward(0.1f); break; } case('s'): { cylinderFrame.MoveForward(-0.1f); break; } case('a'): { cylinderFrame.RotateLocalY(30.0f); break; } case('d'): { cylinderFrame.RotateLocalY(-30.0f); break; } } } int main(int argc, char* argv[]) { gltSetWorkingDirectory(argv[0]); glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowSize(800,600); glutCreateWindow("OpenGL SphereWorld"); glutSpecialFunc(SpecialKeys); glutKeyboardFunc(Keyboard); glutReshapeFunc(ChangeSize); glutDisplayFunc(RenderScene); GLenum err = glewInit(); if (GLEW_OK != err) { fprintf(stderr, "GLEW Error: %s\n", glewGetErrorString(err)); return 1; } SetupRC(); glutMainLoop(); return 0; } [/CODE] Is there a way to set it's origin and for it to move around? When I do set the origin and try to move it, it stays in place but flickers, showing that it is trying to move.
  4. Hi all. So I'm trying to load in an md2 model to use as the controllable character. I have loaded it in just fine, but I'm facing issues when trying to move the model along with the camera. I'm using the SuperBible (5th edition) for my OpenGL, and this project is based on one of the examples. The project isn't OO, so all the code is jammed into one main file, so you can see the code [url="http://ideone.com/gzCZQ"]HERE[/url]. I've tried to set both the camera and the model's origin, but then neither of them move for some reason. If I set the camera origin, and not the model's origin, the model is able to move, and visa versa. Setting neither of their origins works but then ofc, I can't see the model as they're both at (0, 0, 0). What am I doing wrong here? Also, how can I change the controls so that the model moves along with the camera? The way I have it at the moment, the model rotates with 'a' and 'd' and doesn't move to the left of right. Do I need to move the camera behind the model around the model's axis? How do I do this? There's a lot here, I understand, but I can't seem to find out how to solve this! Many, many thanks for any help!
  5. Books to buy

    I have a variety of book on all sorts of subjects, and some that have been strongly recommended for future purchases. For C++ I've used 'Beginning C++ Through Game Programming' and 'C++ A Beginners Guide', the second on which I prefer for covering most of the beginner topics. Due to my course teaching OpenGL and not Direct3D, I have the 'OpenGL SuperBible (5th Edition) which is good for more modern OpenGL programming, though it uses it's own libraries to get around using the older, deprecated OpenGL features (which you'd eventually need to know how not to use). I also have 'Interactive Computer Graphics' but this is very theory heavy and it lost me. It's up to date though so I'm sure it would be useful. I would say that you don't need to learn SDL or anything before you go onto OpenGL, but that's just me. Also on the note of OpenGL, keep your eyes on the new 'OpenGL Programming Guide' which is out in a few months. This will surely cover the core of the latest versions of OpenGL. Aside from general programming and graphics, I have a copy of 'Mathmatics for 3D Game Programming and Computer Graphics' which I've not looked at yet but it's meant to be the best beginners book on the subject. If you're feeling like really getting stuck in, there's also 'Programming AI By Example', which again I've not read, but it's similar to the last book in that it's meant to be the best for beginners. Those are the books I have, anyways. The way I choose books for my learning is actually going on Amazon, and looking at the reviews. Hope that helped somewhat. P.S. I would recommend against the 'Beginning OpenGL for Game Programming' that you already have. I think people recommend it here because it was written, or partly written, by GameDev staff. In this case, that doesn't mean anything.
  6. Hi all. I'm working on a game that uses OpenGL for the graphics and SDL for input. It will require a really simple GUI, such as one with buttons and text boxes (nothing that advanced). What would you suggest for either a UI library I could use, or even tutorials to use to create this simple UI in OpenGL? I've tried a variety of libraries so far, and a IMGUI tutorial for SDL, but they all seem much too advanced for what I need them for and require too much time to learn, when all I want is something very basic.
  7. Eye strain with new monitor

    Hi all. I recently made a topic about getting a second monitor for a dual monitor setup. I went ahead and got a 23" LED HD monitor, to accompany my 21.5" LCD HD monitor. On waking up the day after I had got it and used it, I had some quite severe eye strain, which is still apparent 3 days later. I find this strange as I've heard LED's are meant to reduce eye strain, so what could be the problem here? Could it be that I have two different types of monitors that my eyes are switching from now and again? Could it just be the new monitor? I'm looking into getting a refund or exchange so that I can get something a little less... painful, but I thought I'd come here to ask all you intelligent people first, to see if a reason could be found. The new monitor is an LG E2351 in case that matters. Thanks in advance for any informations!
  8. Google the title... [url="http://glbook.gamedev.net/GLBOOK/glbook.gamedev.net/source.html"]http://glbook.gamedev.net/GLBOOK/glbook.gamedev.net/source.html[/url]
  9. Switching from Console to 2D

    [b]1)[/b] When I first went to 2D, I used an older version of OpenGL, but that's a huge topic so maybe SDL or SFML to begin with. Never used either so can't link to anything. There's plenty OpenGL resources available if you really wanted to jump in deep. It would mean that the jump from 2D to 3D would be easier. [b]2) [/b] I randomly found a game development course after I finished school and am now in my 3rd year. [b]3)[/b] A bit of both, I'd say. You say you've read these books, so you should be able to make something good with what you already know. Try to thinks of ways to do things better, and research ways to doing things you don't know how to do. If there's a substantial amount you don't know about something, take a step back and learn about it first, then tackle it when you're confident enough to.
  10. Dual monitors for increased productivity?

    [quote name='Gaiiden' timestamp='1327357821' post='4905592'] I have a 20" widescreen in the middle and two 17" on either side. Recently added two of [url="http://www.lilliputweb.net/index.php?Controller=User_Product&action=ShowProduct&product_id=83"]these little buggers[/url] - they are great! They are even hardware accelerated now although I hardly use them for anything gaming related. They're mainly used for Skype, media player display and desktop icons. I might just add two more... [/quote] That's some good thinking there! Many thanks to everyone else who's posted. Not sure on a portrait view but I'll explore the idea when I get a second monitor. Not sure if my current one can swivel that way though... Would anybody be kind enough to give me a suggestion to what specific monitors can go well for this use. Like I said, I would like to be able to use them for programming, surfing the net and also to play games on.
  11. Dual monitors for increased productivity?

    I know you don't need the same monitors but I'm a bit weird like that. At the moment, and while my flatmate is away, I'm using a TV as a second monitor so I can watch Freeview from the internet when I want to. Saying that, I don't want another monitor to watch TV, though that could be a possibility. Mainly to split Visual Studio and the web.
  12. Dual monitors for increased productivity?

    [quote name='Hodgman' timestamp='1327322558' post='4905423'] Definately. If I started a new job and there weren't 2 monitors on my new desk, I'd have to immediately ask them where my 2nd monitor is! Ok... maybe not that rudely, but it's such a standard piece of equipment that I would assume any professional programming environment to provide multiple monitors. At my current work, the standard setup (for all staff) is a widescreen monitor + a small LCD TV. If you do get a 2nd one, I'd also recommend a multi-monitor task-bar app, like multimon or ultramon. [/quote] Appreciated! My university opened up a new game development lab and each PC has two monitors, so it must be beneficial to me if they did this. My current monitor doesn't seem that common so I might have to sell this one then get two together.
  13. Hi all. I've got a 21.5" monitor atm and would like to know if getting a second monitor, rather than a larger one, helps when multi-tasking as a game developer. I'm thinking that it would be nice to have my IDE on one monitor, and maybe a tutorial or something else on the second one. Would anybody particularly recommend it?
  14. Steam Great Gift Pile gifts - Anybody want to trade?

    3 pieces of coal and a 33% off Valve games... Wow...
  15. I spent high school in front of my computer

    Opinions. People are allowed them and you are suggested to respect them, whether or not you agree with them. Be happy in who you are and don't let other people opinions belittle you. I for one wished that I had done more programming in my high school years so that I had more time at university to get further ahead. I hear about people who have been programming since they were in their early teens and I'm jealous of those. All I can do now is try my best to get where I want to be.