Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

214 Neutral

About dblalock04

  • Rank
  1. dblalock04

    Quick texturing question

    The day after I started this thread, I came down with the flu. Right before finals too; lucky me. Thank you both for your replies, I'll dive into the code this weekend and get it fixed. I never liked using the tokenizer or object loader. They came from a book which has revealed itself to have more than a couple problems with its code examples. Ultimately I want to write a utility to convert from Collada to a binary format that I can copy directly into buffers, but that's pretty far down the list of things I want to implement. Thanks again for the help
  2. I've been trying to make time to look into this for several weeks now, but graduate studies, work, family, etc, don't leave enough time for personal projects, so I'm turning to gamedev to hopefully point me in the right direction, or even show me the obvious problem I introduced originally. This project is mostly a collection of sub-projects and implementations of ideas and techniques, so please excuse the messy/naive code, but I always welcome constructive criticism. My initial thought was the texture coordinates are wrong, but they appear correct on a quick check in 3ds Max. The screenshot has some notations, I'm also using an object loading that's slightly modified from one I found in one of the DirectX11 game books (.obj is a stop gap until I can write my own format). Please let me know if I've forgotten something. #pragma pack(push, 1) private: struct VertexType { XMFLOAT3 position; XMFLOAT2 texture; XMFLOAT3 normal; }; #pragma pack(pop) bool Mesh::InitializeBuffers(ID3D11Device* device) VertexType* vertices; unsigned long* indices; D3D11_BUFFER_DESC vertexBufferDesc, indexBufferDesc; D3D11_SUBRESOURCE_DATA vertexData, indexData; HRESULT result; int i; vertices = new VertexType[m_vertexCount]; if (!vertices) return false; indices = new unsigned long[m_indexCount]; if (!indices) return false; for (i = 0; i < m_vertexCount; ++i) { vertices.position = XMFLOAT3(m_mesh.x, m_mesh.y, m_mesh.z); vertices.texture = XMFLOAT2(m_mesh.tu, m_mesh.tv); vertices.normal = XMFLOAT3(m_mesh.nx, m_mesh.ny, m_mesh.nz); indices = i; } bool Mesh::LoadMesh(WCHAR* meshFilename) { bool result; float *verts, *norms, *texCoords; int i; m_objLoader = new ObjLoader; result = m_objLoader->LoadFromFile(meshFilename); if (!result) return false; m_vertexCount = m_objLoader->GetVertexCount(); m_indexCount = m_vertexCount; verts = m_objLoader->GetVerticesPtr(); norms = m_objLoader->GetNormalsPtr(); texCoords = m_objLoader->GetTexCoordsPtr(); int vIndex = 0; int nIndex = 0; int tIndex = 0; m_mesh = new MeshType[m_vertexCount]; for (i = 0; i < m_vertexCount; ++i) { m_mesh.z = verts[vIndex] * -1.0f; // Correct vertex winding vIndex++; m_mesh.y = verts[vIndex]; vIndex++; m_mesh.x = verts[vIndex]; vIndex++; } for (i = 0; i < m_objLoader->GetTexCoordsCount(); ++i) { m_mesh.tu = texCoords[tIndex]; tIndex++; m_mesh.tv = texCoords[tIndex]; tIndex++; } for (i = 0; i < m_vertexCount / 3; ++i) { m_mesh.nx = norms[nIndex]; nIndex++; m_mesh.ny = norms[nIndex]; nIndex++; m_mesh.nz = norms[nIndex]; nIndex++; } if (m_objLoader) { m_objLoader->Shutdown(); delete m_objLoader; m_objLoader = 0; } return true; }
  3. Before I turned to programming, I was an (American) English teacher, with a corresponding degree in English. I believe this pretty piece of paper means I'm allowed to decide what is a word and what isn't (it's somewhere in the fine print). Therefore, I am making myself available for evaluation of any words you come up with, pro bono of course. ;)
  4. dblalock04

    Good directx tutorials?

    http://www.two-kings.de/ may be of use to you. I've only just skimmed through it, so I can't attest to the quality of code or ease of understanding, but hopefully you can find something helpful there,
  5. dblalock04

    What was your path?

    When I was quite young, my dad tried to get me interested in programming using basic on a TRS-80 4P (still sitting in a closet back home). I was too interested in playing in the dirt and taking apart the hardware for a few years, so I didn't focus and learn anything really significant until I was a teenager. In middle and high school, I did my share of HTML and PHP to get web sites and rudimentary forums up, but again distractions (this time it was cars and girls) made programming less than a priority. When WoW came out, I got into Lua, but didn't branch out of that application. It wasn't until I had my BA in English and working on an MEd that I finally sat down and dedicated time to learning how to seriously program. My parents, who had suggested computer science as a path of study when I was a teenager, gave Stephen Prada's C++ Primer Plus to me for Christmas. After that, I was hooked on not just learning how to program, but how computers work on every level. After my first semester of teaching high school, I realized that creating software was a passion and not just a hobby. I'm now solidly into a computer science masters program, and learning far more than I ever thought I was capable of. It's a downright cathartic experience. That English degree wasn't totally wasted, ;)
  6. dblalock04

    Obscuring the game code

    When I first started writing applications that I considered more than trivial, I spent a fair amount of time worrying about people stealing my code as well. As many have stated here, it's impossible to completely secure code, and I've come to believe it's actually not worth spending much time trying either. To me, if someone is stealing my code, they probably didn't have the ability to develop it themselves, and will likely end up with an obviously inferior product as a result.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!