• Content count

  • Joined

  • Last visited

Community Reputation

142 Neutral

About TheUmpteenth

  • Rank
  1. OpenGL isometric depth sorting

    Umm, it might be simpler just to say that the z value is equal to the y value (or maxy - y). that way the closer to the bottom of you're screen the sprite is, the more "on top" it is. I might have missed something that you're doing that's making this a bad idea, but I've always been of the "Keep It Simple, Stupid" school.
  2. OpenGL Code that should work.

    np :) glad you got it fixed
  3. OpenGL Camera help

    theres a good camera tutorial on
  4. OpenGL Code that should work.

    Might not be helpful, but You're moving your camera, not the box. You're using glOrtho(), which I've only ever used for 2d and masking. I'd use gluPerspective(). Make sure your box isn't outside of the clipping planes. If I'm thinking straight, the glOrtho() thing doesn't show perspective (objects don't get smaller the further they are from the camera). Think of it as a cuboid as opposed to a pyramid with the top cut off. so that's possibly it.
  5. [discussion] What makes a story good/bad?

    usually, people have to relate to a story. that's how they get immersed. that's it. oh, and I personally like unpredictability.
  6. Neural nets

    you want to start with a perceptron it's the easiest, here's a tutorial, no code tho [url][/url] neural nets generally work in this way, but they're bigger, and some are linked up in different ways. if that's no help, let me know, and i'll try my best to explain.
  7. Z buffer weirdness

    the CLEAR_ZBUFFER call worked, along with ZFUNC, D3DCMP_LESS. Thanks. (boy do I feel sheepish)
  8. HELP!!! Basic glOrtho problem!

    sorry bob, I think you have mistaken me for the thread starter, Merowingian. I was trying to post a solution. (I didn't ever rally use GLUT, so I missed your point about the reshape method) sorry Merowingian, hope I didn't also confuse you.
  9. Z buffer weirdness

    thanks FTQR jollyjeffers Best say this first, but all other questions are answered below I don't really know what im putting in the depth buffer. I want to be representing the distance from the camera to the pixel (as you would guess) D3DXMatrixPerspectiveFovLH(&m_Projection, D3DX_PI/4, 25/25, 2, 1000); I guess that's 2 for Z-near and 1000 for Z-far struct TEXTURED_VERTEX3D { float x,y,z,u,v; }; 64*64 verts per buffer, 9 buffers. that would make one VB 128*128 in size (not sure what unit you would use, but imagine D3DXVECTOR3 (0,0,0) to D3DXVECTOR3 (128,128,128)) for easier understanding, ill include some of my Heightmap code, you'll only be able to tell the size from it tho. //just so you know, its part of a loadRawFile() method // Here we load the .raw file into our pMapSection data array. for (int x=0;x< Width;x++) { for (int y=0; y< Length;y++) { pMapSection[y*Width + x]=f_DataFile.get()/5; } } LPDIRECT3DVERTEXBUFFER9 cMapSection::FillVertices(HWND WinHandle, LPDIRECT3DDEVICE9 pDxDevHandle) { TEXTURED_VERTEX3D* cv_Vertices; LPDIRECT3DVERTEXBUFFER9 p_dx_VertexBuffer; cv_Vertices=new TEXTURED_VERTEX3D[Width*Length]; for (int x=0;x< Width;x++) { for (int y=0; y< Length;y++) { cv_Vertices[y*Width + x].x = (float)(-x*StepSize); cv_Vertices[y*Width + x].z = (float)(y*StepSize); cv_Vertices[y*Width + x].y = (float)(Height(x,y)); if (x!=0) { cv_Vertices[y*Width + x].v = (float)(x/(Width-1.0f)); }else{ cv_Vertices[y*Width + x].v = 0; } if (y!=0) { cv_Vertices[y*Width + x].u = (float)(y/(Length-1.0f)); }else{ cv_Vertices[y*Width + x].u = 0; } } } if (FAILED(pDxDevHandle->CreateVertexBuffer(Width*Length*sizeof(TEXTURED_VERTEX3D), 0, CUSTOM_FVF_TEXTURED, D3DPOOL_DEFAULT, &p_dx_VertexBuffer, NULL ) ) ) { MessageBox(WinHandle,"Error while creating VertexBuffer", "FATAL ERROR!",MB_OK|MB_ICONEXCLAMATION); } VOID* p_Vertices; if (FAILED(p_dx_VertexBuffer->Lock(0, Width*Length*sizeof(TEXTURED_VERTEX3D), (void**)&p_Vertices, 0))) { MessageBox(WinHandle,"Error trying to lock", "FATAL ERROR!",MB_OK|MB_ICONEXCLAMATION); }else{ memcpy(p_Vertices, cv_Vertices, Width*Length*sizeof(TEXTURED_VERTEX3D)); p_dx_VertexBuffer->Unlock(); } return p_dx_VertexBuffer; }
  10. HELP!!! Basic glOrtho problem!

    oh, yeah. ok, here's what I had, or some of it glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); glOrtho( 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0, 1 ); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); //do drawing code here, My code disables the depth test here glMatrixMode( GL_PROJECTION ); glPopMatrix(); glMatrixMode( GL_MODELVIEW );
  11. HELP!!! Basic glOrtho problem!

    glOrtho(left, right, bottom, top, 0,1) can't remember what the 0 and 1 were, think they were near and far planes for z-buffering or something. left and top are usually 0, bottom equates to the height of the paint surface (SCREEN_HEIGHT, usually) and right equates to the width of the paint surface (SCREEN_WIDTH) Used this for a sniper scope once, I also had a glLoadIdentity() after switching to modelview matrix. I hope that helps. let me know if it doesnt.
  12. Z buffer weirdness

    I've just enabled AutoDepthStencilBuffer, as I've been trying to fix a problem with my heightmap. The problem is that the farthest part of my terrain is rendering over the closest part. seemed to me that the z-order was off, but when I enable any z functions (ZFUNC) I get holes in my terrain (or no terrain at all). also tried changing the CULLMODE to D3DCULL_CW, but I lose more geometry that way. I can really figure it out, I was wondering if it was something to do with raw file loaded terrain, or if there's something I'm missing. Just in case you wondered, I'm testing the Buffer Format's compatibility, and it's D3DFMT_D24X8.
  13. cg.dll not found

    thanks. seems like it's not really solving anything, but it works for now.
  14. cg.dll not found

    Hi, I've been trying to work on a little project, and I was about to start work on some simple shaders. I wrote a little cg initialiser, and linked cg in the vs2005 linker (include, lib, bin). When I tryed to run my project i got a message box reading : "This application has failed to start because cg.dll was not found. Re-installing the application may fix this problem." I've re-installed, checked and re-checked my linker directories and additional dependancies (all .lib files) anybody got any idea how to fix this?
  15. collisions with terrain

    .Raw file terrain? start by writing a method which takes as input a position on the map (float/int/double X,Y) and returns the height of the ground at that point.