Main Menu
Menu

Show posts

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.

Show posts Menu

Messages - Tornado7

#1
Support / Relationship between Object3D & texture
October 13, 2004, 03:10:58 PM
Hi Egon,

I'm writing a rapport about my simulator and I'm writing the chapter about jPCT structure... in your notes you draw, using a solid line, that an Object3D has to have a texture.... but, I've used objs in my applet in which I've applied just simple material without textures, so I'm not pretty sure to understand this necessary relation.....

Bye and thanks
#2
Support / Loading textures problem in a web server context
September 16, 2004, 05:24:57 PM
Hi Egon,

finally I did it  :D I solved all my problems, and I accomplished (I hope) all my tasks.... Thanks again for all your help, without I should still be in a swamp  :D
#3
Support / Loading textures problem in a web server context
September 14, 2004, 06:16:20 PM
Hi Egon,

firstable thanks for your code :) . I'm not an expert of php so I need some explanation... The script stands in a stand-alone file, sucha as script.php? The statement dir("."); opens the current dir (if it is so I've to place the php script in to the textures dir). Using which class and method I can run the script from my applet? At the end, I've to pass the "running script method" as input for the getTextFile()? i.e:

BufferedReader in = getTextFile(runScript(script.php));

bye and thanks a lot for your help and patience :oops:
#4
Support / Loading textures problem in a web server context
September 10, 2004, 04:14:16 PM
Here my html code where load the applet:


<table width="101%" height="100%">
 <tr>
   <td width="48%"> <br><br>
     <div align="center"><font size="5" face="arial">Area Incidente</font></div><br>
     <applet name="ThreeDSim"  code="ThreeDSimApplet" width="98%" height="72%"></applet>
.
.
.


and here the exception that I've got:


java.security.AccessControlException: access denied (java.io.FilePermission textures read)

at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)

at java.security.AccessController.checkPermission(AccessController.java:401)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)

at java.lang.SecurityManager.checkRead(SecurityManager.java:887)

at java.io.File.list(File.java:912)

at ThreeDSimApplet.init(ThreeDSimApplet.java:336)

at sun.applet.AppletPanel.run(AppletPanel.java:348)

at java.lang.Thread.run(Thread.java:536)



that is still a security one.... what is pretty odd to me is why, when I give to it an absolute path to the dir, does it work fine, instead, when I give to it a relative path, does it produce an security exception?
#5
Support / Loading textures problem in a web server context
September 09, 2004, 04:45:43 PM
Using simply:

File dir_texture=new File("textures");

it doesn't work  :( . What do you exacty mean with: "You maybe have to set the codebase in the applet-tag"?
#6
Support / Loading textures problem in a web server context
September 09, 2004, 03:41:46 PM
Do not consider for the moment the web server context, and let's think locally... in the current implementation, having an absolute path:



File dir_texture=new File("c:/programs/java_sdk/bin/textures");



my applet works only if I place my applet and the texture dir in c:/programs/java_sdk/bin/ .

If I'd move my applet and his dirs to another path (i.e. c:/myapplet/), I've to change my applet code in this way:



File dir_texture=new File("c:/myapplet/textures");



and so on, whenever I decide to move it in another place or another pc. If I could express in my code a relative path (i.e. /textures) I could move my applet and his dirs everywhere without changing my code everytime.

Hope I've been clear di time  :)

Bye and thanks again
#7
Support / Loading textures problem in a web server context
September 09, 2004, 02:34:01 PM
Let's try to consider the problem from another point of view... Basically my problem is that now I express an absolute path that points to the textures directory:



File dir_texture=new File("c:/programs/java_sdk/bin/textures");



so, if I've to move my applet (and his related directory) to another working directory or I copy the applet to a pc that hasn't this path I've to change every the path in the code.... I'd solve my problem if I could express a relative path (i.e. something like /textures) instead of expressing an absolute one that I've to change every time I move the applet in another place.

Bye and thanks
#8
Support / Loading textures problem in a web server context
September 08, 2004, 12:35:27 PM
Hi Egon,

I've to move my jPCT applet in a web server (EasyPHP) context; in my current version I load my textures giving to it a path in my local drive:


File dir_texture=new File("C:/Programmi/Java_SDK/bin/textures");        String[] files_texture=dir_texture.list();
      for (int i=0; i<files_texture.length; i++) {
         
           String name_texture=files_texture[i];          
           if (name_texture.endsWith(".jpg")) {          
               texMan.addTexture(name_texture, new Texture(getDocumentBase(),"textures/"+name_texture));             }
       
      }


Running the applet with the web server the Java Console obviously says:


java.security.AccessControlException: access denied (java.io.FilePermission textures read)

at java.security.AccessControlContext.checkPermission(AccessControlContext.java:270)

at java.security.AccessController.checkPermission(AccessController.java:401)

at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)

at java.lang.SecurityManager.checkRead(SecurityManager.java:887)

at java.io.File.list(File.java:912)

at ThreeDSimApplet.init(ThreeDSimApplet.java:336)

at sun.applet.AppletPanel.run(AppletPanel.java:348)

at java.lang.Thread.run(Thread.java:536)



exist a way to load the textures in this new context considering that I've to load them automatically, I mean, loading them using a loop as in the current version?

Bye and thanks
#9
Support / Two little questions
July 16, 2004, 12:06:16 PM
Ok, now it works  :D

Bye and thanks a lot for your help :wink:
#10
Support / Retriving obj’s position value
July 07, 2004, 11:35:40 AM
No, it has no effect.....but, doing a better collision detection calibration I've got a good behaviour.... Bye and thanks :D
#11
Support / Retriving obj’s position value
July 05, 2004, 07:13:16 PM
ok, now collision detecyion works but, you guess..... I've still some problem.....  :D I'm experimenting using check types: checkForCollisionSpherical isn't good enough in my situation; I've tried checkForCollisionEllipsoid and I've an odd behaviuor; I've defined the following:

if ((obj_bw) && (!feritoID.equals("none"))){
                   
  Object3D oggetto=theWorld.getObjectByName(feritoID);
  SimpleVector collision= new SimpleVector(44f,15f,10f);
  SimpleVector translate= new SimpleVector(-5f,0f,0f);
  translate=oggetto.checkForCollisionEllipsoid(translate, collision, 5);
  oggetto.translate(translate);
                         
               }

using collision with the above SimpleVector's values the obj compenetrate a bit in the wall; if I change the collision values into:

SimpleVector collision= new SimpleVector(45f,15f,10f);

it's too much off the wall: why changing by just 1 unit I've a so different result?
I've even tried to use checkForCollision method:

if ((obj_bw) && (!feritoID.equals("none"))){
                   
  Object3D oggetto=theWorld.getObjectByName(feritoID);
  SimpleVector direction= new SimpleVector(1,0,0);
  SimpleVector translate= new SimpleVector(-5f,0f,0f);
  translate=oggetto.checkForCollision(direction, 10);
  oggetto.translate(translate);
                         
               }

but the compiler says:

ThreeDSimApplet.java:864: incompatible types
found   : int
required: com.threed.jpct.SimpleVector
  translate=oggetto.checkForCollision(direction, 10);
                                                          ^
Note: ThreeDSimApplet.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
1 error

any explaination. Bye and thanks  :)
#12
Support / Retriving obj’s position value
July 02, 2004, 01:54:33 PM
Ok, now it moves as I wish  :D , but I've still problems with collision detection :( : I've setted the "moving obj" using this code:


miscObj.setCollisionMode(Object3D.COLLISION_CHECK_SELF);
miscObj.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
miscObj.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);


and the world's objs with the following:


mondo.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
mondo.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);


but, even using your code, it still compenetrates the world's objs  :?:
#13
Support / Retriving obj’s position value
July 01, 2004, 01:54:33 PM
Ok, I've got it, but I'm experimenting two new problems; here follows the code used for to load the moving objs:


Object3D[] miscArray=Loader.load3DS(getDocumentBase(),"3ds/oggetti/"+name_obj, 20f);
         Object3D miscObj=miscArray[0];
           miscObj.setCenter(SimpleVector.ORIGIN);
           miscObj.translate (-462, -30, -186);
           miscObj.rotateX((float)-Math.PI/2);
           miscObj.rotateMesh();
           miscObj.setRotationMatrix(new Matrix());
     
           miscObj.createTriangleStrips(2);
           miscObj.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
         miscObj.setCollisionOptimization(Object3D.COLLISION_DETECTION_OPTIMIZED);
           
           miscObj.build();
           theWorld.addObject(miscObj);



When I select it using the following in Main():


if (clicked) {
                   
                        SimpleVector ray=Interact2D.reproject2D3D(camera, buffer, mouseX, mouseY);
                        int[] res=Interact2D.pickPolygon(theWorld.getVisibilityList(), ray);

                        if (res!=null) {
                            Object3D pickedObjs=theWorld.getObject(Interact2D.getObjectID(res));
                            feritoID = pickedObjs.getName();
                        }
                                             
                        clicked=false;
                       
                     }  



and press 'w' key, the obj has to move on his x axis; so, I've used the following code in timer():


if ((obj_up) && (feritoID != "none")){
               
                Object3D oggetto;
                oggetto=theWorld.getObjectByName(feritoID);
                SimpleVector coordinate = oggetto.getTranslation();
                coordinate.x=-462.1f;
                oggetto.translate(coordinate);
                       
               }


even if I've changed the x value with a small value (0.1) it covers a long distance in the applet; another problem is collision detection doesn't work and the obj compenetrate the others. Any suggestion?  :?

Bye and thanks
#14
Support / 3D Objects & IDs
June 29, 2004, 02:08:20 PM
Ok Egon, thanx :)
#15
Support / 3D Objects & IDs
June 28, 2004, 11:17:50 AM
Hi Egon,

I'm here again... I'd ask you in which way, if it's possible, I can express a 3D Object using is ID instead of is name; i.e.:

something like Object3D(ID).animate instead of animateMe.animate

It's possible to force a 3D Object to get a specific id (I've just find out a method to set the id of the next obj)?

Bye and thanks