Skip to content
sunag edited this page Dec 2, 2016 · 18 revisions

SEA3D ( Three.JS )

Features

  • Mesh, Sprite, Container, Sound 3D, Material, Texture, Cube Map, Lights, Camera, Geometry, Skeleton, Joint Object, Line, Dummy, Script, GLSL
  • Animation Takes: Keyframe, Vertex, Skin, Morph, Light, Camera
  • Geometry 16-32 bit
  • Multi-Material
  • Native script support
  • Node Material
  • Ammo.js Physics Loader
  • Embed or Link Textures, CubeMaps, Sounds ( JPG, PNG, GIF, MP3 )
  • Deflate, LZMA and Lossy Compression
  • Binary format
  • Optimized to Three.JS

Loader

Requires

<script src="three.js"></script>

<script src="SEA3D.js"></script>
<script src="SEA3DLZMA.js"></script>
<script src="SEA3DLoader.js"></script>

Load a Asset

var loader = new THREE.SEA3D();

loader.onComplete = function( e ) {

	// Use loader.get... to get an object

	var mesh = loader.getMesh( "My Asset" );

	scene.add( mesh );

};

loader.load( 'asset.tjs.sea' );

Config

Allows change the load context of the assets.

var loader = new THREE.SEA3D({
	scripts : true
});

// or

var loader = new THREE.SEA3D();
loader.config.scripts = true;

Parameters

scripts : true

Load scripts and actions on assets.

runScripts : true

Run scripts and actions on assets. Use loader.domain.runScripts() as alternative.

autoPlay : false

Play automatically all animations.

dummys : true

Load lines and dummys.

multiplier : true

Multiplier light intensity.

bounding : true

Compute automatically BoundingBox and BoundingSphere.

lights : true

Load lights.

forceStatic : true

Force all 3d objects for static.

physics : true

Load embed physics objects.

convexHull : true

Use ConvexHull as default otherside ConvexTriangleMeshShape will be used.

enabledPhysics : true

Apply physics in object at load.

streaming : true

Read automatically the assets.

timeLimit : 10

Time processing limit up waiting for another frame.

Node Material

Node Material allows the interconnection of nodes for creating customized materials.

Aditional Requires

<script src="NodeMaterial.js"></script>
<script src="SEA3DNodeMaterial.js"></script>

Phong

var mat = new THREE.SEA3D.PhongMaterial();

mat.ambientColor = new THREE.ColorNode( 0xFF0000 );
mat.diffuse = new THREE.ColorNode( 0x0000FF );
//mat.diffuse = new THREE.TextureNode( threejsTexture ); // replace color to texture
mat.specularColor = new THREE.ColorNode( 0x00FF00 );
mat.shininess = new THREE.FloatNode( 3 );

// necessary to build the material
mat.build();

Rim

var mat = new THREE.SEA3D.PhongMaterial();

mat.enabledRim = true; // It is necessary before to set the values of the shader

mat.rimColor.value.setHex( 0xFF );
mat.rimIntensity = 1.3;
mat.rimPower.number = 3;

mat.build();

Fresnel

var mat = new THREE.SEA3D.PhongMaterial();

mat.enabledFresnel = true; // It is necessary before to set the values of the shader

mat.fresnelPower.number = 1;
mat.fresnelReflectance.number = 1.3;

mat.build();
Clone this wiki locally