706
Support / my 3DS files dnt work
« on: December 26, 2004, 12:50:13 pm »
It Should work, but it doesnt, its okay if I send you all the folder with all the files so you can check it please!!!!!!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
What are you talking about?
levelParts=Loader.load3DS(this.getDocumentBase(), "bajos.3ds", 1f);//Cargo el mapa
level=new Object3D(0);//inicializo el onjeto level
for (int i=0; i<levelParts.length; i++) {
Object3D part=levelParts[i];
part.setCenter(SimpleVector.ORIGIN);
part.rotateX((float)-Math.PI/2);
part.rotateMesh();
part.setRotationMatrix(new Matrix());
if (part.getName ().compareTo("ventana03_jPCT62")==0)
part.setTransparency (0);
if (part.getName ().compareTo("ventana04_jPCT61")==0)
part.setTransparency (0);
if ((i&1)==1)
part.setTransparency(0);
level=Object3D.mergeObjects(level, part);
}
Are you really using checkCameraCollision()? If so, you should better use checkCameraCollisionEllipsoid() instead. If it still doesn't work, maybe the scale of you scene is too large. Play around with Config.collideOffset in that case.
private void formKeyPressed(java.awt.event.KeyEvent evt) {
// Add your handling code here:
if (evt.getKeyChar()=='w') {
if (theWorld.checkCameraCollision(1, 3)==false)
camera.moveCamera (Camera.CAMERA_MOVEIN, 3);
}
if (evt.getKeyChar()=='s') {
if (theWorld.checkCameraCollision(-1, 3)==false)
camera.moveCamera (Camera.CAMERA_MOVEOUT, 3);
}
if (evt.getKeyChar()=='a')
camera.rotateAxis(camera.getBack().getYAxis(), -0.065f);
if (evt.getKeyChar()=='d')
camera.rotateAxis(camera.getBack().getYAxis(), 0.065f);
if (evt.getKeyChar()==' ')
camera.moveCamera (Camera.CAMERA_MOVEUP,5);
if (evt.getKeyChar () == 'z')
camera.moveCamera (Camera.CAMERA_MOVEDOWN,5);
repaint ();
}
Your code looks ok to me. It's just that it couldn't find the 3DS-file. Make sure that it can and it should work. However, i can offer you some small tutorials that somebody wrote a while ago. I've uploaded them here:
http://www.jpct.net/download/Tutorials.zip
Please note that i haven't tested these nor did i had a closer look at them. The guy who wrote them seemed to have stopped working on them, so i give them to you in the state they had when i got them. I hope they compile...if they don't, please let me know. It can't be difficult to make them do.