Hi Gattomanzo,
Rawimage.lib is a public library to read/write images, it support most of the common formats and it is multiplatform. We rename it to rawimage2003 to avoid confusions with the VS2005 version, sorry for the inconveniences. You can dowload the source and compile it yourself, for instance here:
http://kde-apps.org/content/show.php?content=30971
But I have zipped it here so you wont need to compile anything:
http://rapidshare.de/files/25858417/raw ... 3.zip.html
We will add it to the sdk package if possible.
//----------------------------------------------------
// This is a working very very simple example:
//----------------------------------------------------
// Define a callback funcion that maxwell will call when there is an error:
byte pErrorCallBack( byte isError, const char *pMethod, const char *pError, const void *pValue )
{
if ( isError )
{
// It is a good idea to put a breakpoint here
// Also it is a good idea to check all the functions return byte = 1
}
return ( 0 );
}
Cmaxwell* pScene= new Cmaxwell( pErrorCallback );
// Set a blue sky dome
Crgb skyColor;
skyColor.assign( 0.0, 0.0, 1.0 );
pScene->setSkyConstant(skyColor, 5 );
// Create a camera
Cpoint from, Cpoint to, Cvector up;
from, .assign( 0,0,0);
to.assign(0,0,-1);
up.assign(0,1,0);
pScene->createCamera( 1, 1/125, 0.024, 0.036, 100, "CIRCULAR",
30, 6, 25, 800, 600, 1);
pScene->setCamera( 0, from, to, up, 0.050, 8, false );
// Create a default material
Cmaxwell::Cmaterial yourMaterial = pScene->createMaterial( "gattomanzo material", true );
// Create a mesh with just one triangle and apply the material to it
Cmaxwell::Cobject yourMesh = pScene->createMesh( "gattomanzo mesh", 3, 3, 1, 1 );
yourMesh .setMaterial( yourMaterial );
// Set a couple of render parameters and tonemapping
dword maxTime = 1;
pScene->setRenderParameter( "STOP TIME", sizeof ( dword ), &maxTime );
dword sL = 18;
pScene->setRenderParameter( "SAMPLING LEVEL", sizeof ( dword ), &sL);
pScene->setToneMapping( 2.2, 0.7);
// Write the file
pScene->writeMXS( "C:\test.mxs" );
// Launch maxwell render
char buffer[256]
sprintf( buffer, "mxcl.exe -mxs:\"%s\" " , "C:\test.mxs" );
system( buffer );
// I hope it helps
// Juan