3DzzD Tutorial
Earn $$ with WidgetBucks! Earn $$ with WidgetBucks!
01/03 - Basic

how to load 3D files
Scene overview :
About :  
Root
DefaultLight
DefaultCamera
CUBE.3DS
Camera01
CUBE

This sample show how to load and display 3d files with few lines.

get the current 3D Scene
this.getScene3DRender().getScene3D()...

specify the file to load
.... loadScene3DFrom3DS(this.getBaseURL()+"MODELS/","CUBE.3DS");

handle the loading process by using the render3DObjectMonitor event
if(r.getScene3D().getMesh3DByName("CUBE.3DS")!=null) //Loaded ??

select a camera for rendering
r.getScene3D().setCurrentCamera3DByName("Camera01");

set background color
r.getScene3D().setBackgroundColor(0xFFFFFF);

set light direction
IPoint3D lr=r.getScene3D().getLight3DById(0).getRotation();
lr.set(-0.8,-0.6,0);


Compilation :
Runtime :
to compile this sample, ensure that you have java SDK properly installed and use the following command line
javac -target 1.1 -d . -classpath LIB/dzzd.jar

for windows users click on the provided make file
make.bat

you can run the demo by opening the provided HTML index file on your browser
index.html

to add this demo in your own web site, copy/paste the following HTML source code.
     <APPLET code="Sample.class" 
               archive="LIB/dzzd.jar"
               width="676"
               height="380"
               MAYSCRIPT>
      </APPLET>


Links :
to download this sample source code:
Sample.java

to download the full tutorial package, including API and Javadoc :
API25112006.ZIP

for last news and last demos please visit 3DzzD web site :
http://dzzd.net/

to ask and talk with other users please visit the forum:
http://www.tdt3d.com/forum.php?action=vtopic&forum=25