Jump to content
  • Advertisement

Anddos

Member
  • Content count

    1059
  • Joined

  • Last visited

Everything posted by Anddos

  1. Anddos

    open source x file format library

    i remember reading about this http://www.toymaker.info/Games/html/xanimator.html
  2. how do i make a save file system for a first person type game?
  3. Anddos

    Problems displaying a mesh

    you will still need lighting regardless if the mesh has no materials or textures
  4. This is the rendering code to render and do a pick test on the terrain What i want todo next is increase the picked triangles vertices for mouse 1 and decrease for mouse 2 , so that i can sculpt it to how i like I know i have to lock the vertex buffer but i am unsure how to get the positions and adjust them and when todo it // Clear the backbuffer and depth buffer.     HR(gd3dDevice->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffeeeeee, 1.0f, 0));     HR(gd3dDevice->BeginScene());     // Setup the rendering FX     HR(mFX->SetMatrix(mhViewProj, &(mView*mProj)));     HR(mFX->SetTechnique(mhTech));     UINT numPasses = 0;     HR(mFX->Begin(&numPasses, 0));     HR(mFX->BeginPass(0));     HR(gd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME));     HR(mTerrainMesh->DrawSubset(0));     // Switch back to solid mode.     HR(gd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID));     // Did we pick anything?     D3DXVECTOR3 originW(0.0f, 0.0f, 0.0f);     D3DXVECTOR3 dirW(0.0f, 0.0f, 0.0f);     if( gDInput->mouseButtonDown(0) )     {         getWorldPickingRay(originW, dirW);         BOOL hit = 0;         DWORD faceIndex = -1;         float u = 0.0f;         float v = 0.0f;         float dist = 0.0f;         ID3DXBuffer* allhits = 0;         DWORD numHits = 0;         HR(D3DXIntersect(mTerrainMesh, &originW, &dirW, &hit,             &faceIndex, &u, &v, &dist, &allhits, &numHits));         ReleaseCOM(allhits);         // We hit anything?         if( hit )         {             // Yes, draw the picked triangle in solid mode.             IDirect3DVertexBuffer9* vb = 0;             IDirect3DIndexBuffer9* ib = 0;             HR(mTerrainMesh->GetVertexBuffer(&vb));             HR(mTerrainMesh->GetIndexBuffer(&ib));             HR(gd3dDevice->SetIndices(ib));             HR(gd3dDevice->SetVertexDeclaration(VertexPNT::Decl));             HR(gd3dDevice->SetStreamSource(0, vb, 0, sizeof(VertexPNT)));             // faceIndex identifies the picked triangle to draw.             HR(gd3dDevice->DrawIndexedPrimitive(                 D3DPT_TRIANGLELIST, 0, 0, mTerrainMesh->GetNumVertices(), faceIndex*3, 1))                          ReleaseCOM(vb);             ReleaseCOM(ib);         }     }     HR(mFX->EndPass());     HR(mFX->End());          mGfxStats->display();     HR(gd3dDevice->EndScene());     // Present the backbuffer.     HR(gd3dDevice->Present(0, 0, 0, 0));
  5. Anddos

    Problems displaying a mesh

    have you added a light source ? // this is the function that sets up the lights and materials void init_light(void) {     D3DLIGHT9 light;    // create the light struct     D3DMATERIAL9 material;    // create the material struct     ZeroMemory(&light, sizeof(light));    // clear out the light struct for use     light.Type = D3DLIGHT_DIRECTIONAL;    // make the light type 'directional light'     light.Diffuse = D3DXCOLOR(0.5f, 0.5f, 0.5f, 1.0f);    // set the light's color     light.Direction = D3DXVECTOR3(-1.0f, -0.3f, -1.0f);     d3ddev->SetLight(0, &light);    // send the light struct properties to light #0     d3ddev->LightEnable(0, TRUE);    // turn on light #0     ZeroMemory(&material, sizeof(D3DMATERIAL9));    // clear out the struct for use     material.Diffuse = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);    // set diffuse color to white     material.Ambient = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f);    // set ambient color to white     d3ddev->SetMaterial(&material);    // set the globably-used material to &material }   //set these after you make the device   d3ddev->SetRenderState(D3DRS_LIGHTING, TRUE);    // turn on the 3D lighting d3ddev->SetRenderState(D3DRS_ZENABLE, TRUE);    // turn on the z-buffer d3ddev->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(50, 50, 50));    // ambient light  
  6. Anddos

    Basic Terrain editor help

    when i do this   UINT vidx[3]; vidx[0] = ib[ faceIndex*3 + 0 ]; vidx[1] = ib[ faceIndex*3  + 1 ]; vidx[2] = ib[ faceIndex*3 + 2 ];   http://snag.gy/71y92.jpg   also where does .position come from?
  7. Anddos

    should i release my code?

    yes , release it to gitub, ive always had problems with skinned meshs when not using the dx .x helper functions, does it use shaders as well?
  8. Anddos

    livecoding.tv

    Just letting fellow programmers know about a site to for just coding https://www.livecoding.tv
  9. I am loading a traffic lights model with the.x functions the problem is i want 3 texture states for the lights etc, red, amba , green , how would i load 3 different textures if the model loading function loads 1 texture?   for(DWORD i = 0; i < numMaterials; i++)    // for each material...     {         material = tempMaterials.MatD3D;    // get the material info         material.Ambient = material.Diffuse;    // make ambient the same as diffuse         // if there is a texture to load, load it         if(FAILED(D3DXCreateTextureFromFileA(d3ddev,                                              tempMaterials.pTextureFilename,                                              &texture)))         texture = NULL;    // if there is no texture, set the texture to NULL       }   could i not use D3DXCreateTextureFromFileA 3 times on the different texture states and apply the texture this way? because in code i need to set device->SetTexture(&red); , device->SetTexture(&amba); device->SetTexture(&green); http://i.imgur.com/hGL4nHH.png?1 thanks if you can help
  10. Anddos

    Creating Traffic lights (.x)

    sorry Buckeye can you elaborate on that idea
  11. Anddos

    Creating Traffic lights (.x)

    would that work with as an animated x tho?, how would you animate the lights exactly?
  12. I am trying to load md5 data from my own format, i write it like this its working fine for .obj , so i am not sure what the issue is std::ofstream outfileBinary ("objdataBin.data",std::ofstream::out | std::ofstream::binary);                  //write indices outfileBinary.write((char*)&subset.indices[0], subset.indices.size() * sizeof(subset.indices[0]));   //write vertices outfileBinary.write((char*)&subset.vertices[0], subset.vertices.size() * sizeof(subset.vertices[0])); outfileBinary.close();   //reading the data std::vector <Vertex> VecVerts; std::vector <DWORD> VecIndices; VecVerts.resize(subset.vertices.size()); VecIndices.resize(subset.indices.size());   std::ifstream infileBinary ("objdataBin.data",std::ifstream::in | std::ifstream::binary);     if(infileBinary.is_open())     {         infileBinary.read((char*)&VecIndices[0], subset.indices.size() * sizeof(subset.indices[0]));         infileBinary.read((char*)&VecVerts[0], subset.vertices.size() * sizeof(Vertex));              }   // Create index buffer                 D3D11_BUFFER_DESC indexBufferDesc;                 ZeroMemory( &indexBufferDesc, sizeof(indexBufferDesc) );                 indexBufferDesc.Usage = D3D11_USAGE_DEFAULT;                 indexBufferDesc.ByteWidth = sizeof(DWORD) * subset.numTriangles * 3;                 indexBufferDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;                 indexBufferDesc.CPUAccessFlags = 0;                 indexBufferDesc.MiscFlags = 0;                 D3D11_SUBRESOURCE_DATA iinitData;                 iinitData.pSysMem = &VecIndices[0]; //&subset.indices[0];                 d3d11Device->CreateBuffer(&indexBufferDesc, &iinitData, &subset.indexBuff);   //Create Vertex Buffer                 D3D11_BUFFER_DESC vertexBufferDesc;                 ZeroMemory( &vertexBufferDesc, sizeof(vertexBufferDesc) );                 vertexBufferDesc.Usage = D3D11_USAGE_DYNAMIC;                            // We will be updating this buffer, so we must set as dynamic                 vertexBufferDesc.ByteWidth = sizeof( Vertex ) * subset.vertices.size();                 vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;                 vertexBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;                // Give CPU power to write to buffer                 vertexBufferDesc.MiscFlags = 0;                 D3D11_SUBRESOURCE_DATA vertexBufferData;                 ZeroMemory( &vertexBufferData, sizeof(vertexBufferData) );                 vertexBufferData.pSysMem = &VecVerts[0]; //&subset.vertices[0];                 hr = d3d11Device->CreateBuffer( &vertexBufferDesc, &vertexBufferData, &subset.vertBuff);  
  13. well the sample works if i use the loaded vectors from the .md5 hence the left screenshot, i dont know what can cause this just having loaded the data from a file i made and reading it in rather than directly parsing the .md5 etc..
  14. yes there the same after writing the read in data to .txt files, ive tried with an obj model and that worked fine
  15. if i wanted to make a third person camera, how do you work how the yaw direction and to move in that direction, prefilbly, i want to be using directx input for mouse data, thanks if you can help
  16. so how do you rotate the player with the mouses yaw/pitch input
  17.            i am basically using the  ID3DXLine object to represent a slider to set the view fov,i cant understand        why after i set the position with the mouse it starts to decrease by its self..              in my render scene code i have             if(LMBDown)             {                 if((float)mouseX > 550.0f)                 {                     vLine[0].x = 550.0f;                     vLine[0].y = 160.0f;                     vLine[1].x =  (float)mouseX;                     vLine[1].y =  160.0f;                                       }             }              pLine->Begin( );              pLine->Draw( vLine, 2,D3DCOLOR_XRGB( 0, 100, 0 ));              pLine->End( );  
  18. I am using mysql to store player data, how can i protect the strings that connect to the database from being comprimised by memory reading etc
  19. Anddos

    how to protect mysql strings?

    Thanks for the replys, good information there
  20. Anddos

    Should I Port to D3D10 or D3D11 ?

    does gui buttons work differently for dx11?, i am still kind of stuck how to convert my d3d9 menu to d3d11, its using vertices with RHW etc
  21. if i try to build my c++ mysql project in x86 i get these errors 1> mysql.cpp 1>mysql.cpp(63): warning C4101: 'sbuffer' : unreferenced local variable 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_init@4 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_real_connect@32 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_error@4 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_query@8 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_store_result@4 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_num_fields@4 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_fetch_row@4 1>mysql.obj : error LNK2001: unresolved external symbol _mysql_fetch_lengths@4 1>C:\Users\Dickyb0b\documents\visual studio 2010\Projects\mysql\Release\mysql.exe : fatal error LNK1120: 8 unresolved externals 1> 1>Build FAILED. 1> 1>Time Elapsed 00:00:01.06 ====== Rebuild All: 0 succeeded, 1 failed, 0 skipped ====== it works fine for x64, i dont really want an x64 binary so i would like to build my project as x86, i believe my mysql installer is x86 yet i am able to build my project as x64 which is not what i wanted, can anyone help?
  22. his is the path C:\Program Files\MySQL\MySQL Server 5.6\lib there is no x86 folder or x64 folder , there is just the libs, so there is no others to choose from
  23. If i create a texture and render it on to a triangle in screenspace (RHW) , how do i split up to the triangle in to small rect compartments that have different meanings when certain items are dragged in to them, etc, lets say its a third person game and in order to power vechiles you need to petrol cans from your inventory to the cars inventory but only at a certain area of the triangle, the other area of triangle would stand for different things etc, i hope ive explained that right
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!