How to use my 3D objects in Framsticks ? 

How can I use my 3D objects to put them in the world of Framsticks ?
Like the apple for the food . I see it seems to be an AC file. Can we use
other 3D formats for this ?
If not, how to produce AC files without AC3D, because this software isn't
free...

Alain Lioret

Forums: 
Szymon Ulatowski's picture

Alain Lioret wrote:
> How can I use my 3D objects to put them in the world of Framsticks ?
> Like the apple for the food . I see it seems to be an AC file. Can we use
> other 3D formats for this ?
> If not, how to produce AC files without AC3D, because this software isn't
> free...

framsticks uses the SSG library for 3d models loading/saving.
it supports several file formats - see the table here:
http://plib.sourceforge.net/ssg/non_class.html
in particular, you can use the popular 3ds models but they have to be
scaled down (most 3d studio objects are bigger than the whole framsticks
world). textures can also be used but the only supported formats are
BMP, PNG and SGI (you have to convert GIF and JPG files) and
the texture bitmap size should be a power of two (opengl requirement).
another issue is how framsticks knows what files will be used.
it is defined by the style scripts (*.style files in 3dobj folder).
you can use the standard.style as a base for your custom visualisation
(copy it under another name). then, replace

function food_part_build()
{loadAndAddAsTransformNode("apple.ac");}

with

function food_part_build()
{loadAndAddAsTransformNode("apple.3ds");}

we can make it load different food items instead of the boring apples:

function food_part_build()
{
var items=["apple.ac","cola.3ds","hamburger.ac","banana.3ds"];
loadAndAddAsTransformNode(items[Math.rnd01*items.size]);
}

the style script can also build the model from scratch (it is used for
creating ground and water) and combine multiple models (this is how
the sticks and receptors are joined into creatures).

sz.

Ok, thank you for all these precisions.
Is there a complete doc somewhere about building new styles ? (All the
functions and commands possible)
Can we just use AC and 3DS files ? I tried to use OBJ files, but it crash !

Alain Lioret

"Szymon Ulatowski" a écrit dans le message de
news:c12enj$5c4$1@cancer.cs.put.poznan.pl...
> Alain Lioret wrote:
> > How can I use my 3D objects to put them in the world of Framsticks ?
> > Like the apple for the food . I see it seems to be an AC file. Can we
use
> > other 3D formats for this ?
> > If not, how to produce AC files without AC3D, because this software
isn't
> > free...
>
> framsticks uses the SSG library for 3d models loading/saving.
> it supports several file formats - see the table here:
> http://plib.sourceforge.net/ssg/non_class.html
> in particular, you can use the popular 3ds models but they have to be
> scaled down (most 3d studio objects are bigger than the whole framsticks
> world). textures can also be used but the only supported formats are
> BMP, PNG and SGI (you have to convert GIF and JPG files) and
> the texture bitmap size should be a power of two (opengl requirement).
> another issue is how framsticks knows what files will be used.
> it is defined by the style scripts (*.style files in 3dobj folder).
> you can use the standard.style as a base for your custom visualisation
> (copy it under another name). then, replace
>
> function food_part_build()
> {loadAndAddAsTransformNode("apple.ac");}
>
> with
>
> function food_part_build()
> {loadAndAddAsTransformNode("apple.3ds");}
>
> we can make it load different food items instead of the boring apples:
>
> function food_part_build()
> {
> var items=["apple.ac","cola.3ds","hamburger.ac","banana.3ds"];
> loadAndAddAsTransformNode(items[Math.rnd01*items.size]);
> }
>
>
> the style script can also build the model from scratch (it is used for
> creating ground and water) and combine multiple models (this is how
> the sticks and receptors are joined into creatures).
>
> sz.
>

Szymon Ulatowski's picture

Alain Lioret wrote:

> Ok, thank you for all these precisions.
> Is there a complete doc somewhere about building new styles ? (All the
> functions and commands possible)

there are few general documents about scripting in framsticks:
http://www.framsticks.com/common/script/index.html
and the objects/functions reference:
http://www.framsticks.com/common/script/docs/index.html
but there is no real documentation focused on styles.
nevertheless, people with some hacker attitude would probably succeed in
creating custom styles. and you can always ask here. :-)

> Can we just use AC and 3DS files ? I tried to use OBJ files, but it crash !

as i said, we use SSG loading functions, they have some limitations
depending on the format. i use the AC only and don't have any experience
with other formats.

sz.