Page 1 of 1

rawimage2003.lib

Posted: Fri Jul 14, 2006 8:05 pm
by gattomanzo
what is rawimage2003.lib? it doesn't appear in google.

i've tryed to create a MXS with SDK 1.1, but when i include maxwell.h and compile i have an error.

can we have a working example of MXS cretion code? in sdk manual we have only pseudo code.

many thanks for any help

Posted: Fri Jul 14, 2006 10:59 pm
by juan
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

Posted: Sat Jul 15, 2006 12:13 am
by gattomanzo
juan wrote:But I have zipped it here so you wont need to compile anything:
http://rapidshare.de/files/25858417/raw ... 3.zip.html
ehm Juan... can you send it to me via mail please? rapidshare and my provider can't stand each others...

thanks anyway

Posted: Sat Jul 15, 2006 12:25 am
by victor

thanks

Posted: Sat Jul 15, 2006 12:29 am
by gattomanzo
thanks victor

Posted: Sat Jul 15, 2006 1:13 am
by gattomanzo
juan wrote:system( buffer );
ALAS !!! this won't works, all the rest seems fine

Posted: Sat Jul 15, 2006 1:31 am
by juan
gattomanzo wrote:
juan wrote:system( buffer );
ALAS !!! this won't works, all the rest seems fine
Try with it:

sprintf(buffer, "start mxcl.exe -d -mxs:"%s" -o:"%s"","c:\test.mxs", "c:\test.jpg" );

system( buffer );

In this case we enable the -d parameter to launch the UI maxwell window, also the call is done throught a "start" command and also we especify an output path for the image. If this is not working I suggest you to use CreateProcess or any other W32 funtion for launching an external app inside other one.

Juan

Juan