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 - mgrabul

#1
Support / 3d models with texture
February 12, 2011, 10:27:56 PM
Hi I have a project presentation about augmented reality and I am using the JPCT game engine. I have problem in putting 3D models in my application(i don't understand blender), the problem is that I can't set the texture to the model becouse I cant find  (on net) a .3ds model with a texture mapped following the JPCT rule . If some one has some 3D models with correctly mapped  texture in blender and ready to use with JTPC  Please send me the bout files, a .3ds and a texture file. Or if is possible to use Please send me a .ser file or a link to a web site were I can download .3ds models with correctly maped texture for use in JPCT.
Sorry if the question is very basic
#2
Support / 3D models
February 12, 2011, 10:26:09 PM
Hi I have a project presentation about augmented reality and I am using the JPCT game engine. I have problem in putting 3D models in my application(i don't understand blender), the problem is that I can't set the texture to the model becouse I cant find  (on net) a .3ds model with a texture mapped following the JPCT rule . If some one has some 3D models with correctly mapped  texture in blender and ready to use whit JTPC  Please send me the bout files, a .3ds and a texture file. Or if is possible to use Please send me a .ser file or a link to a web site were I can download .3ds models whit correctly maped texture for use in JPCT.
Sorry if the question is very basic
#3
Support / Re: 3d library
October 10, 2010, 03:45:46 AM
Quote from: EgonOlsen on October 08, 2010, 08:24:26 PM
There are several pitfalls when loading objects. First, you are doing this:


jeep=Loader.load3DS(res.openRawResource(R.raw.jipp), 5)[0];


while i tend to do this myself, it's actually a hack that only works for models that consist of just one part. If that's not given, you'll only add the first part to the world and depending on the model, this can be anything. Try to do


jeep=Object3D.mergeAll(Loader.load3DS(res.openRawResource(R.raw.jipp), 5));


instead.

Second, object space of a model can be anything. Your jeep model might cover coordinates from -10 to 10 or from -100000 to 0 or from -100000 to -99990. Try to play around with the scale of the model to see if that changes something as well as with the models translation. To get a quick grasp of how the model is located in object space, print out the center (Object3D.getCenter()).

Third, make sure that there is light. A black jeep in front of a black background isn't really visible. I tend to choose another color for the background for testing purposes.

Thanks for the replay it was very helpful and it solves my problem but the black screen whas probably caused by tthe performance of my phone (g1)  and it still needs time to draw the screen for the first time
#4
Support / Re: 3d library
October 08, 2010, 03:00:13 PM
Quote from: EgonOlsen on October 07, 2010, 07:47:16 AM
Which errors  ???
I am sorry I have no errors, but when I try to add a new 3d object from a the raw folder, the screen becomes black (I am using the code from the demo example). This is my code:

private Object3D jeep=null;
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
         TextureManager.getInstance().flush();
         world = new World();
         Resources res = getResources();

         TextureManager tm = TextureManager.getInstance();
                        ................................
                        .....................................
                       jeep=Loader.load3DS(res.openRawResource(R.raw.jipp), 5)[0];
                          jeep.translate(-200, -10, 50);
                        world.addObject(jeep);
}

I try to add a new objec from the file jipp.3ds, I equerd the file from http://dmi3d.comeze.com/modelsvehicle2.html it is a .lwo file so I used Blender to export the file in .3ds
please tell me what am I doing wrong or explane a simpe way to add 3d models in mu application
#5
Support / Re: 3d library
October 07, 2010, 11:34:26 PM
I am sorry I have no errors, but when I try to add a new 3d object from a the raw folder, the screen becomes black (I am using the code from the demo example). This is my code:

private Object3D jeep=null;
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
         TextureManager.getInstance().flush();
         world = new World();
         Resources res = getResources();

         TextureManager tm = TextureManager.getInstance();
                        ................................
                        .....................................
                       jeep=Loader.load3DS(res.openRawResource(R.raw.jipp), 5)[0];
                          jeep.translate(-200, -10, 50);
                        world.addObject(jeep);
}

I try to add a new objec from the file jipp.3ds, I equerd the file from http://dmi3d.comeze.com/modelsvehicle2.html it is a .lwo file so I used Blender to export the file in .3ds
please tell me what am I doing wrong or explane a simpe way to add 3d models in mu application
#6
Support / 3d library
October 07, 2010, 01:16:13 AM
Hi can some one point out a librery whit a 3d models that I can easely use to load 3d models in my application.
I found http://dmi3d.comeze.com/modelsvehicle2.html and I realy like the models but I have trouble importing them in the application. I first installed Blender in order to export the files in a .3ds fromat. After I exported the model in a .3ds format I still had problems ranning the application and I get an error. can someone explane in details the easiest way for adding 3d models to my application. Please:)
#7
Support / Re: using sensor to rotate camera
October 06, 2010, 09:21:37 PM
Thanks for the code. I made my own code using the example you posted earlier but i still heven quite figure out the oreintation and the plasement of the objects in the 3d space. I hope after I study this code things will be easier to unrerstand:)
#8
Support / using sensor to rotate camera
September 25, 2010, 01:34:01 PM
Can some one post a simple code (example) on using phone sensors to rotate jpct camera.
I tried reading the topics on the forum  but the code is not complete.I think that a coomplite code will be interesting for all the users of the forum. 
and becouse I am new to android I will realy aprriciate a simple code.
#9
Support / Re: camera rotating problem demo
September 18, 2010, 02:15:55 PM
Quote from: raft on September 17, 2010, 11:52:11 PM
that's right. Camera.rotateXXX(..) methods rotates camera around it's position. in other words camera's rotation pivot is always its position.
if you need to rotate camera around and arbitrary pivot, you should do the math yourself. it's not that hard. some trigonometry will be enough.

or alternatively, you can add a dummy child to a dummy object, rotate parent object as required and set camera's position to child object's position.

Thanks for the replay
I'am new to open gl and the jpct class so I am sorry for the stupid questions:)
I tried this code for rotating left and right byt i stil get the same effect.
(the different line is the line whit the ****)
if (StartEngine.touchTurn != 0) {
                  
         ****   world.getCamera().rotateCameraAxis(new SimpleVector(0.0,1.0,0.0),StartEngine.touchTurn);
            Y=world.getCamera().getYAxis();
            X=world.getCamera().getXAxis();
         StartEngine.touchTurn = 0;
               }
how can I compute the roating vector ?
can you please tell me what am I doing wrong?
or show me how it is done
p.s
for the Y  vector when I am rottating around X(rotatin down up) i am geting this values:
for down rotatin:
Y AXIS(3182): (0.0,0.999803,0.019883258)
Y AXIS(3182): (0.0,0.999803,0.019883258)
Y AXIS(3182): (0.0,0.99955416,0.029880127)
Y AXIS(3182): (0.0,0.99955416,0.029880127)
and for up rottating:
Y AXIS(3182): (0.0,0.99955416,0.029880127)
Y AXIS(3182): (0.0,0.99955416,0.029880127)
Y AXIS(3182): (0.0,0.999803,0.019883258)
Y AXIS(3182): (0.0,0.999803,0.019883258)
#10
Support / camera rotating problem demo
September 17, 2010, 10:42:17 PM
Hi I have a problem with the rotation of the camera in the demo code at http://www.jpct.net/jpct-ae/, it seams that the camera rotates around its own axis i can't make it rotate around a paralel axis from the world.
for example if I rotate the camera down or up and then right or left I get a view that has not a paralel horizot to the first view horizont.
    this is my code:


      public void onDrawFrame(GL10 gl) {

         try {
            if (!stop) {
               if (paused) {
                  Thread.sleep(500);
               } else {
                  Camera cam = world.getCamera();
                  if (turn != 0) {
                     world.getCamera().rotateY(-turn);
                  }

                  if (touchTurn != 0) {
                     world.getCamera().rotateY(touchTurn);
                     touchTurn = 0;
                  }

                  if (touchTurnUp != 0) {
                     world.getCamera().rotateX(touchTurnUp);
                     touchTurnUp = 0;
                  }

                  if (move != 0) {
                     world.getCamera().moveCamera(cam.getDirection(), move);
                  }

                  fb.clear();
                  world.renderScene(fb);
                  world.draw(fb);
                  blitNumber(lfps, 5, 5);

                  fb.display();

                  sun.rotate(new SimpleVector(0, 0.05f, 0), plane.getTransformedCenter());

                  if (System.currentTimeMillis() - time >= 1000) {
                     lfps = (fps + lfps) >> 1;
                     fps = 0;
                     time = System.currentTimeMillis();
                  }
                  fps++;
                  ind += 0.02f;
                  if (ind > 1) {
                     ind -= 1;
                  }
               }
            } else {
               if (fb != null) {
                  fb.dispose();
                  fb = null;
               }
            }
         } catch (Exception e) {
            Logger.log("Drawing thread terminated!", Logger.MESSAGE);
         }
      }