A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [INFO] ASE 3d- format discovery

  1. #1
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756

    [INFO] ASE 3d- format discovery

    i´ll try making it short in this first post:

    this is a insight of me about the ASE (3dsmax ASCI Export) format. Hopefully everthing important is within the image:



    here is a little tutorial how to get your 3d-models out of 3dsmax into a ASE file suitable for flash:



    just to make sure here is the sample file again as actual text:
    Code:
    *3DSMAX_ASCIIEXPORT	200
    *COMMENT "AsciiExport Version  2.00 - Sun Feb 11 01:16:37 2007"
    *SCENE {
    	*SCENE_FILENAME ""
    	*SCENE_FIRSTFRAME 0
    	*SCENE_LASTFRAME 100
    	*SCENE_FRAMESPEED 30
    	*SCENE_TICKSPERFRAME 160
    	*SCENE_BACKGROUND_STATIC 0.0000	0.0000	0.0000
    	*SCENE_AMBIENT_STATIC 0.0000	0.0000	0.0000
    }
    *GEOMOBJECT {
    	*NODE_NAME "Plane01"
    	*NODE_TM {
    		*NODE_NAME "Plane01"
    		*INHERIT_POS 0 0 0
    		*INHERIT_ROT 0 0 0
    		*INHERIT_SCL 0 0 0
    		*TM_ROW0 1.0000	0.0000	0.0000
    		*TM_ROW1 0.0000	1.0000	0.0000
    		*TM_ROW2 0.0000	0.0000	1.0000
    		*TM_ROW3 -1.0840	1.0840	0.0000
    		*TM_POS -1.0840	1.0840	0.0000
    		*TM_ROTAXIS 0.0000	0.0000	0.0000
    		*TM_ROTANGLE 0.0000
    		*TM_SCALE 1.0000	1.0000	1.0000
    		*TM_SCALEAXIS 0.0000	0.0000	0.0000
    		*TM_SCALEAXISANG 0.0000
    	}
    	*MESH {
    		*TIMEVALUE 0
    		*MESH_NUMVERTEX 4
    		*MESH_NUMFACES 2
    		*MESH_VERTEX_LIST {
    			*MESH_VERTEX    0	-33.0840	-30.9160	0.0000
    			*MESH_VERTEX    1	30.9160	-30.9160	0.0000
    			*MESH_VERTEX    2	-33.0840	33.0840	0.0000
    			*MESH_VERTEX    3	30.9160	33.0840	0.0000
    		}
    		*MESH_FACE_LIST {
    			*MESH_FACE    0:    A:    0 B:    1 C:    3 AB:    1 BC:    1 CA:    0	 *MESH_SMOOTHING 1 	*MESH_MTLID 0
    			*MESH_FACE    1:    A:    3 B:    2 C:    0 AB:    1 BC:    1 CA:    0	 *MESH_SMOOTHING 1 	*MESH_MTLID 0
    		}
    		*MESH_NUMTVERTEX 4
    		*MESH_TVERTLIST {
    			*MESH_TVERT 0	0.0000	1.0000	0.0000
    			*MESH_TVERT 1	0.0000	0.0000	0.0000
    			*MESH_TVERT 2	1.0000	1.0000	0.0000
    			*MESH_TVERT 3	1.0000	0.0000	0.0000
    		}
    		*MESH_NUMTVFACES 2
    		*MESH_TFACELIST {
    			*MESH_TFACE 0	1	3	2
    			*MESH_TFACE 1	2	0	1
    		}
    	}
    	*PROP_MOTIONBLUR 0
    	*PROP_CASTSHADOW 1
    	*PROP_RECVSHADOW 1
    }
    some samples of what can be done with ASE files:

    my personal current development,- an isometric game:

    starting @ http://board.flashkit.com/board/show...9&postcount=41

    papervision, opensource fast flash 3d engine
    http://osflash.org/papervision3d

    sandy, self claimed best 3d API
    http://www.flashsandy.org/


    hope that gives some newcommers some basic insight,- still here some interesting links I found during my discovery (no particular order):
    http://www.devmaster.net/forums/showthread.php?t=2258
    http://wiki.beyondunreal.com/wiki/ASE_File_Format
    http://www.solosnake.com/main/ase.htm (very good insight)

  2. #2
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    totally forgot here are some usefull functions I wrote for parsing the ASE files (some very rough ones, but they worked very well for me):

    1 function for finding and replacing text elements of a particular string:
    Code:
    function fr(txt,id,r){//fr = find and replace
    	var max = 1000;//security!
    	var pos = 0;
    	var done=0;
    	while (done<=max && pos<>-1){
    		pos = txt.indexOf(id);
    		if (pos<>-1){
    			done++;
    			var a = txt.slice(0,pos);
    			var b = txt.slice(pos+id.length,txt.length);
    			txt = a+""+r+""+b;
    		}else{
    			done++;
    			break;
    		}
    	}
    	return(txt);
    }
    what it does: it searches within the string variable txt for the string variable id and replaces it with the string variable r.
    samples:
    removing all tabs within text
    Code:
    var new_text = fr(my_string , "\t" , "");
    remove double returns (for some reason some parts of my loaded ASE file had always a new line after a return)
    Code:
    var new_text = fr(my_string , "\r\n" , "\n" );
    replacing weired '&quot;' with real quotes:
    [/code]var new_text = fr(my_string , "&quot;" , "\"" );[/code]

    --------------------------------------------------------
    1 function for getting a node- block of the text
    Code:
    function getNode(from,header){
    	var p = from.indexOf(header)
    	if (p<>-1){
    		var s1 = p+header.length;
    		var s2 = from.indexOf("}",s1);
    		var out = from.slice(s1,s2);
    		return({val:out,s:s2});
    	}else{
    		return("");
    	}
    }
    what it does: again from given string from it searches for the string variable header. If it finds it it returns 2 Objects, 1 with all characters following after the search string till the first curly brace "}", the other one of the position of where the curly brace character was found. So it is only usefull for single element blocks not for blocks that contain other blocks.
    sample:
    Code:
    my_block = getNode(my_string , "*MESH_TVERTLIST {" ).val;

    feel free to use them or improve them

  3. #3
    supervillain gerbick's Avatar
    Join Date
    Jul 2000
    Location
    undecided.
    Posts
    18,986
    Thanks a ton for sharing... I'll be redoing the 3D resources thread... mind if I add this to the list?

    [ Hello ] | [ gerbick ] | [ Ω ]

  4. #4
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    np,- feel free to ad, I thought that goes without saying if someone posts something here.

  5. #5
    Ich lerne jede Tag etwas Neues Evaman's Avatar
    Join Date
    Nov 2006
    Location
    Die Welt
    Posts
    236
    whoot! go render!

  6. #6
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    repost of the first post since I had to swtich image servers:

    i´ll try making it short in this first post:

    this is a insight of me about the ASE (3dsmax ASCI Export) format. Hopefully everthing important is within the image:



    here is a little tutorial how to get your 3d-models out of 3dsmax into a ASE file suitable for flash:



    just to make sure here is the sample file again as actual text:
    Code:
    *3DSMAX_ASCIIEXPORT	200
    *COMMENT "AsciiExport Version  2.00 - Sun Feb 11 01:16:37 2007"
    *SCENE {
    	*SCENE_FILENAME ""
    	*SCENE_FIRSTFRAME 0
    	*SCENE_LASTFRAME 100
    	*SCENE_FRAMESPEED 30
    	*SCENE_TICKSPERFRAME 160
    	*SCENE_BACKGROUND_STATIC 0.0000	0.0000	0.0000
    	*SCENE_AMBIENT_STATIC 0.0000	0.0000	0.0000
    }
    *GEOMOBJECT {
    	*NODE_NAME "Plane01"
    	*NODE_TM {
    		*NODE_NAME "Plane01"
    		*INHERIT_POS 0 0 0
    		*INHERIT_ROT 0 0 0
    		*INHERIT_SCL 0 0 0
    		*TM_ROW0 1.0000	0.0000	0.0000
    		*TM_ROW1 0.0000	1.0000	0.0000
    		*TM_ROW2 0.0000	0.0000	1.0000
    		*TM_ROW3 -1.0840	1.0840	0.0000
    		*TM_POS -1.0840	1.0840	0.0000
    		*TM_ROTAXIS 0.0000	0.0000	0.0000
    		*TM_ROTANGLE 0.0000
    		*TM_SCALE 1.0000	1.0000	1.0000
    		*TM_SCALEAXIS 0.0000	0.0000	0.0000
    		*TM_SCALEAXISANG 0.0000
    	}
    	*MESH {
    		*TIMEVALUE 0
    		*MESH_NUMVERTEX 4
    		*MESH_NUMFACES 2
    		*MESH_VERTEX_LIST {
    			*MESH_VERTEX    0	-33.0840	-30.9160	0.0000
    			*MESH_VERTEX    1	30.9160	-30.9160	0.0000
    			*MESH_VERTEX    2	-33.0840	33.0840	0.0000
    			*MESH_VERTEX    3	30.9160	33.0840	0.0000
    		}
    		*MESH_FACE_LIST {
    			*MESH_FACE    0:    A:    0 B:    1 C:    3 AB:    1 BC:    1 CA:    0	 *MESH_SMOOTHING 1 	*MESH_MTLID 0
    			*MESH_FACE    1:    A:    3 B:    2 C:    0 AB:    1 BC:    1 CA:    0	 *MESH_SMOOTHING 1 	*MESH_MTLID 0
    		}
    		*MESH_NUMTVERTEX 4
    		*MESH_TVERTLIST {
    			*MESH_TVERT 0	0.0000	1.0000	0.0000
    			*MESH_TVERT 1	0.0000	0.0000	0.0000
    			*MESH_TVERT 2	1.0000	1.0000	0.0000
    			*MESH_TVERT 3	1.0000	0.0000	0.0000
    		}
    		*MESH_NUMTVFACES 2
    		*MESH_TFACELIST {
    			*MESH_TFACE 0	1	3	2
    			*MESH_TFACE 1	2	0	1
    		}
    	}
    	*PROP_MOTIONBLUR 0
    	*PROP_CASTSHADOW 1
    	*PROP_RECVSHADOW 1
    }
    some samples of what can be done with ASE files:

    my personal current development,- an isometric game:

    starting @ http://board.flashkit.com/board/show...9&postcount=41

    papervision, opensource fast flash 3d engine
    http://osflash.org/papervision3d

    sandy, self claimed best 3d API
    http://www.flashsandy.org/


    hope that gives some newcommers some basic insight,- still here some interesting links I found during my discovery (no particular order):
    http://www.devmaster.net/forums/showthread.php?t=2258
    http://wiki.beyondunreal.com/wiki/ASE_File_Format
    http://www.solosnake.com/main/ase.htm (very good insight)

  7. #7
    Flash Genie letschillout's Avatar
    Join Date
    Feb 2007
    Location
    31.52949, 74.347272
    Posts
    146
    ...... amazing! thanks bro for all info!
    Charag - 3D, Flash Games, Animations,
    Website Development & More...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center