Export one single geometry AWD2

Software: Other

Avatar
Luca, Sr. Member
Posted: 10 August 2013 01:49 PM   Total Posts: 230

This is only a skeletal ( simple as possible i hope ) of the code needed to export a single geometry, with no material assigned, by using the AWD2 file format specifics

 

File Attachments
AwdExport.zip  (File Size: 1170KB - Downloads: 220)
   

Avatar
Luca, Sr. Member
Posted: 11 August 2013 02:18 PM   Total Posts: 230   [ # 1 ]

Ops raspberry sorry ...

public function BuildHeaderBlockHeaderID:uintDataTypeID:uint ):ByteArray
{
 
 
//
 
var BlockHeader:ByteArray = new ByteArray();
 
BlockHeader.endian Endian.LITTLE_ENDIAN;
 
 
_blockId++;
 
 
// MATERIAL BLOCK HEADER
 
BlockHeader.writeUnsignedIntHeaderID );   // Block ID      32 +
 
BlockHeader.writeByte);       // Block namespace handle  8 +
 
BlockHeader.writeByteDataTypeID );    // Block data type ID   8 +
 
BlockHeader.writeByte);       // Flags      8
 
BlockHeader.writeUnsignedInt);     // Block data size in bytes  Offset = 56 bytes
 
 //
 
return BlockHeader;
 

Bits not Bytes, 1 Byte = 8 bit, so the offset, in bytes are:
uint32 ( word ) = 4 bytes +
byte = 1 byte +
byte = 1 byte +
byte = 1 byte =
7 bytes. The first byte are at index ( offset ) 0 so the 8th byte are at offset 7 smile

http://en.wikipedia.org/wiki/Word_(computer_architecture)
https://en.wikipedia.org/wiki/Endianness

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X