Original Post
Now that I want to use some complex meshes, and i am starting to learn how to put .obj vertex, index,UV,normals info in a D3D10_SUBRESOURCE_DATA.
I dont want to load my meshes from a .obj dirtectly, I want them to just be in a file were i just have to do this fast and simple thing:
D3D10_SUBRESOURCE_DATA InitData;
FILE * file;
fp = fopen("mesh.mesh","rb");
fread(vertices,sizeof(VERTEXCHUNKPART),1,file);
InitData.pSysMem = &vertices
Is this possible?
If its possible, how to make the file, lets say i just have a mesh of 2 vertex with position (0,0,0)and (1,1,1)
so i have a text file with just this:
2 //because of 2 vertices
000
111
how can i convert that text into the file that can be loaded fast and simple.
FINAL EDIT
Now i see(yes I am stupid), my real question is having for example
SimpleVertex vertices[] =
{
D3DXVECTOR3( -1.0f, 1.0f, 0.0f ),
D3DXVECTOR3( 1.0f, 1.0f, 0.0f ),
D3DXVECTOR3( -1.0f, -1.0f, 0.0f ),
D3DXVECTOR3( 1.0f, -1.0f, 0.0f ),
};
how can i output vertices in to a file directly, outputting that chunk of memory directly into a file
I dont want to load my meshes from a .obj dirtectly, I want them to just be in a file were i just have to do this fast and simple thing:
D3D10_SUBRESOURCE_DATA InitData;
FILE * file;
fp = fopen("mesh.mesh","rb");
fread(vertices,sizeof(VERTEXCHUNKPART),1,file);
InitData.pSysMem = &vertices
Is this possible?
If its possible, how to make the file, lets say i just have a mesh of 2 vertex with position (0,0,0)and (1,1,1)
so i have a text file with just this:
2 //because of 2 vertices
000
111
how can i convert that text into the file that can be loaded fast and simple.
FINAL EDIT
Now i see(yes I am stupid), my real question is having for example
SimpleVertex vertices[] =
{
D3DXVECTOR3( -1.0f, 1.0f, 0.0f ),
D3DXVECTOR3( 1.0f, 1.0f, 0.0f ),
D3DXVECTOR3( -1.0f, -1.0f, 0.0f ),
D3DXVECTOR3( 1.0f, -1.0f, 0.0f ),
};
how can i output vertices in to a file directly, outputting that chunk of memory directly into a file