Everything related to SDK.
By gattomanzo
#171224
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
User avatar
By juan
#171269
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
Last edited by juan on Fri Aug 18, 2006 10:35 am, edited 1 time in total.
By gattomanzo
#171314
juan wrote:system( buffer );
ALAS !!! this won't works, all the rest seems fine
User avatar
By juan
#171317
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

Probably the use of two "." in the file […]

Maxwell and Blender

An addon for Blender would be amazing. It would in[…]

Hey Patrik, thanks for the suggestion. 🙌🏼 Creams […]

Hi ki_cz, this is my attempt with another engine,[…]