Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Anddos

Member Since 01 Nov 2002
Offline Last Active Apr 29 2015 05:51 PM

Topics I've Started

Loading own md5 format causes scewed model

24 April 2015 - 11:35 AM

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);
 

how do you work out the direction to move a third person camera?

26 February 2015 - 05:46 PM

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


using a line for a slider

22 February 2015 - 06:27 PM

           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( );
 

how to protect mysql strings?

27 January 2015 - 03:52 PM

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


cant compile c++ mysql as x86 project

11 January 2015 - 05:39 AM

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?


PARTNERS