PsyVision

Members
  • Content count

    96
  • Joined

  • Last visited

Community Reputation

130 Neutral

About PsyVision

  • Rank
    Member
  1. what do you think these errors mean?

    why did you not just leave the lib and headers where the psdk put them and add them to the include directories under the settings in VC++ ?
  2. J2EE vs .NET

    Mastering more things already, make that 10 years: http://www.gamedev.net/community/forums/topic.asp?topic_id=307707 Youve already chosen Java by the looks of it: http://www.gamedev.net/community/forums/topic.asp?topic_id=300494 It sounds like you want to rule the world with your master this master that programming just like the pro's without actually working your way up the ladder of knowledge: http://www.gamedev.net/community/forums/topic.asp?topic_id=285500 *Sigh*
  3. J2EE vs .NET

    Some people just make you want to bash your head as hard as possible on your monitor.
  4. How do i do this

    Try learning ASM
  5. Hey, I've got my terrain engine going, quadtree'd, VBO'd etc etc. I recently implemented the positioning of the camera as a interpolated height based upon the heights of the triangle the player is above. However, this (although works) doesn't allow the player to move particuarly smoothly especially because my terrain has quite small triangles making up the mesh. I have been looking at using something along the lines of ODE, RAPID, SOLID to create a collision system using quadtree children (containing a tri mesh for the node) and a sphere as the camera to achieve smoother movement. Would you see this as suitable or would making a simple sphere-triangle collision detection routine work better? I was thinking of using a pre-made SDK such as the ones listed above as i could then use this for collisions between bullets, players, pickups etc etc later on.
  6. errors

    Are you totaly sure the .lib files exist where they should be? If theyre setup in the project file AND exist on disk, it should work.
  7. Walking on terrain

    unsigned int nPos = GetVertexIndex(int(floor((kPoint.X() - m_kBigBound.m_kMin.X()) / 7.5f)), int(floor((kPoint.Z() - m_kBigBound.m_kMin.Z()) / 7.5f)), m_uiWidth, m_uiHeight); float lx = (kPoint.X() - m_akVertex[nPos].X()); float lz = (kPoint.Z() - m_akVertex[nPos].Z()); int ix = floor(lx); int iz = floor(lz); if (ix < 0) ix = 0; if (ix > 1) ix = 1; if (iz < 0) iz = 0; if (iz > 1) iz = 1; lx -= ix; if (lx < 0) lx = 0; if (lx > 1) lx = 1; lz -= iz; if (lx < 0) lz = 0; if (lz > 1) lz = 1; nPos = GetVertexIndex(int(0), int(0), m_uiWidth, m_uiHeight); int cx = floor((kPoint.X() - m_akVertex[nPos].X()) / 7.5f); int cz = floor((kPoint.Z() - m_akVertex[nPos].Z()) / 7.5f); nPos = GetVertexIndex(int(cx), int(cz), m_uiWidth, m_uiHeight); float s00, s01, s10, s11; nPos = GetVertexIndex(int(cx), int(cz), m_uiWidth, m_uiHeight); s00 = m_akVertex[nPos].Y(); nPos = GetVertexIndex(int(cx), int(cz + 1), m_uiWidth, m_uiHeight); s01 = m_akVertex[nPos].Y(); nPos = GetVertexIndex(int(cx + 1), int(cz), m_uiWidth, m_uiHeight); s10 = m_akVertex[nPos].Y(); nPos = GetVertexIndex(int(cx + 1), int(cz + 1), m_uiWidth, m_uiHeight); s11 = m_akVertex[nPos].Y(); fHeight = (s00 * (1-lx) + s01 * lx) * (1 - lz) + (s10 * (1-lx) + s11 * lx) * lz; Just to let you know i got it working with the above code, might help anyone else who's stuck.
  8. Walking on terrain

    Well, I've used what you said in my code below. Im currently trying to position a ball on my terrain. It works fine with a totally flat terrain but not with a randomly generated (and then smoothed) terrain. Its picking the correct triangle and the normal is all fine. Vertex p1, p2, p3; Vertex d1, d2, normal, middle; float d; // Find where we are in the heightmap int x = floor(g_vBall.x); int z = floor(g_vBall.z); // Get the percentage between 0 -> 1 dX = g_vBall.x - g_vHeightmap[x][z].x; dZ = g_vBall.z - g_vHeightmap[x][z].z; if (dX + dZ <= 1.0f) { // Top left triangle p1.x = g_vHeightmap[x][z].x; p1.y = g_vHeightmap[x][z].y; p1.z = g_vHeightmap[x][z].z; p2.x = g_vHeightmap[x+1][z].x; p2.y = g_vHeightmap[x+1][z].y; p2.z = g_vHeightmap[x+1][z].z; p3.x = g_vHeightmap[x][z+1].x; p3.y = g_vHeightmap[x][z+1].y; p3.z = g_vHeightmap[x][z+1].z; } else { // Bottom right triangle p3.x = g_vHeightmap[x+1][z+1].x; p3.y = g_vHeightmap[x+1][z+1].y; p3.z = g_vHeightmap[x+1][z+1].z; p2.x = g_vHeightmap[x+1][z].x; p2.y = g_vHeightmap[x+1][z].y; p2.z = g_vHeightmap[x+1][z].z; p1.x = g_vHeightmap[x][z+1].x; p1.y = g_vHeightmap[x][z+1].y; p1.z = g_vHeightmap[x][z+1].z; } // Calculate normal d1.x = p1.x - p2.x; d1.y = p1.y - p2.y; d1.z = p1.z - p2.z; d2.x = p3.x - p2.x; d2.y = p3.y - p2.y; d2.z = p3.z - p2.z; normal.x = (d1.y * d2.z) - (d1.z * d2.y); normal.y = (d1.z * d2.x) - (d1.x * d2.z); normal.z = (d1.x * d2.y) - (d1.y * d2.x); float length = sqrt((normal.x * normal.x) + (normal.y * normal.y) + (normal.z * normal.z)); normal.x /= length; normal.y /= length; normal.z /= length; // Middle of our triangle (for drawing the normal) middle.x = (p1.x + p2.x + p3.x) / 3.0f; middle.y = (p1.y + p2.y + p3.y) / 3.0f; middle.z = (p1.z + p2.z + p3.z) / 3.0f; // D for our plane d = (normal.x * p1.x) + (normal.y * p1.y) + (normal.z * p1.z); // Height the ball should be at float h = -((normal.x * dX) + (normal.z * dZ) + d) / normal.y; glPushMatrix(); glTranslatef(g_vBall.x, h, g_vBall.z); glColor3f(0.0f, 1.0f, 0.0f); auxSolidSphere(0.5f); glPopMatrix(); Edit: Yes i know i should use a vector class to make it a lot easier, ive got all of my rendering done in another app which has a good vector class but this was a small debug app i whipped up trying to wort out whats wrong.
  9. Walking on terrain

    I'm trying to sort this out too. So far... I can work out what quad i'm in but haven't cut it down to which triangle in the quad. Am i correct in thinking i need to: 1. Work out which triangle i'm in 2. Work out the normal of the triangle (gives me a, b, c) (What about d?) 3. Plug a, b, c and the position x, z into the plane equation to get y ?
  10. http://oss.sgi.com/projects/ogl-sample/GLsdk.zip
  11. OpenGL Removing #FF00FF in texture

    You can either use a second texture as an alpha map with some kind of masking (OpenGL blending) OR Read in the texture data to a buffer, create a new buffer with enough room for an alpha channel. ie instead of 3 bytes per pixel youd have 4 bytes (something like that). then you check each pixel's colour and if its FF00FF (magenta?) then you set the alpha channel to 255 otherwise set it to 0.
  12. Discuss Object rotations

    I think you might be experiencing the 'gimball lock'.
  13. Ya i know its not clicky but heres my current engine: http://www.psyvision.co.uk/screen.jpg I'd be happy to read it over, richardcaunt@hotmail.com ;)
  14. .OBJ texture mapping

    www.gametutorials.com