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

how to rotate 3D object
Scene overview :
About :  
Root
DefaultLight
DefaultCamera
CUBE.3DS
Camera01
CUBE

This sample show how to rotate an object in the 3d scene.

handle each frame loop in world space by using the render3DWorldSpace event
public void render3DWorldSpace(IScene3DRender r)

verify if loading is done
if(r.getScene3D().getMesh3DByName("CUBE.3DS")==null)
return;


get object we want to interact with
IScene3DObject obj=r.getScene3D().getMesh3DByName("CUBE");

get its rotation controler
IPoint3D rot=obj.getRotation();

finaly, increase y component to rotate
rot.setY(rot.getY()+0.05);

tips : move can be performed with the position controler
IPoint3D pos=obj.getPosition();

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