Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actuallomateron

Posted 06 November 2012 - 01:49 PM

I just made the simplest model loader

Code that creates the file with the mesh

[source lang="java"]#include <stdio.h>#include <d3dx10math.h>int main (){  FILE * pFile;D3DXVECTOR3 vertices[] ={{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},};DWORD indices[] ={ 0,1,2,};  pFile = fopen ( "myfile.bin" , "wb" );  fwrite (vertices , 1 , sizeof(vertices) , pFile );  fwrite (indices , 1 , sizeof(indices) , pFile );  fclose (pFile);  return 0;}[/source]
Code that loads the file with the mesh

[source lang="java"] FILE * pFile; pFile = fopen ( "myfile.bin" , "rb" ); D3DXVECTOR3 vertices[3]; fread (vertices,sizeof(vertices),1,pFile); DWORD indices[3]; fread (indicess,sizeof(indices),1,pFile); fclose (pFile);[/source]

#2lomateron

Posted 06 November 2012 - 01:48 PM

I just made the simplest model loader

Code that creates the file with the mesh

[source lang="java"]#include <stdio.h>#include <d3dx10math.h>int main (){  FILE * pFile;D3DXVECTOR3 vertices[] ={{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},};DWORD indices[] ={ 0,1,2,};  pFile = fopen ( "myfile.bin" , "wb" );  fwrite (vertices , 1 , sizeof(vertices) , pFile );  fwrite (indices , 1 , sizeof(indices) , pFile );  fclose (pFile);  return 0;}[/source]
Code that loads the file with the mesh

[source lang="java"] FILE * pFile; pFile = fopen ( "myfile.bin" , "rb" ); D3DXVECTOR3 verticess[3]; fread (vertices,sizeof(vertices),1,pFile); DWORD indicess[3]; fread (indicess,sizeof(indices),1,pFile); fclose (pFile);[/source]

#1lomateron

Posted 06 November 2012 - 01:47 PM

I just made the simplest model loader

Code that creates the file with the mesh

[source lang="java"]#include <stdio.h>#include <d3dx10math.h>int main (){  FILE * pFile;D3DXVECTOR3 vertices[] ={{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},{ D3DXVECTOR3( 1.0f,1.0f,1.0f )},};DWORD indices[] ={ 0,1,2,};  pFile = fopen ( "myfile.bin" , "wb" );  fwrite (vertices , 1 , sizeof(vertices) , pFile );  fwrite (indices , 1 , sizeof(indices) , pFile );  fclose (pFile);  return 0;}[/source]
Code that loads the file with the mesh

[source lang="java"]        FILE * pFile; pFile = fopen ( "myfile.bin" , "rb" );        D3DXVECTOR3 verticess[3]; fread (vertices,sizeof(vertices),1,pFile); DWORD indicess[3]; fread (indicess,sizeof(indicess),1,pFile); fclose (pFile);[/source]

PARTNERS