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.


Messages - subhalakshmi27

Pages: 1 [2]
16
Bones / Re: collision with Bones
« on: January 12, 2012, 02:35:07 pm »
Hi Raft,

Sorry I forgot to mention this before, I am checking collision with bones in Android (JPCT-AE). I will check again what you have mentioned. Does Android engine can have an impact in Collision detection with bones  ::)?

Regards,
Subha

17
Bones / collision with Bones
« on: January 12, 2012, 12:05:41 pm »
Hi All,

In normal 3D object in World space, following collision detection code worked.

sphere.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);
            sphere.addCollisionListener(new CollisionListener() {
               
               @Override
               public boolean requiresPolygonIDs() {
                  // TODO Auto-generated method stub
                  return false;
               }
               
               @Override
               public void collision(CollisionEvent arg0) {
                  Log.i("HelloWorldJPCT", "Sphere collision");
                  
               }
            });

When I tried the collision detection in Bones sample code , I never got any log message, Following is the code

ninjas.get(0).get(0).setCollisionMode(Object3D.COLLISION_CHECK_SELF);
      ninjas.get(0).get(0).addCollisionListener(new CollisionListener() {
         
         @Override
         public boolean requiresPolygonIDs() {
            // TODO Auto-generated method stub
            return false;
         }
         
         @Override
         public void collision(CollisionEvent ce) {
            // TODO Auto-generated method stub
            Log.i("app", "On collision");
            
         }
      });

Please let me know if I am missing something.

Regards,
Subha

18
Bones / Re: Ogre to Bones conversion
« on: December 26, 2011, 06:51:55 am »
Hi Raft,

Thanks for the reply. My artist has exported the mesh and skeleton separately in Maya that was the reason for missing skeleton link.

Now the skeleton link is not missing. But when I tried converting to bones I am getting the following error,

Skeleton created out of jME OGRE skeleton, 48 joints
Exception in thread "main" java.lang.NullPointerException
        at raft.jpct.bones.BonesImporter.convertJMEMeshData(BonesImporter.java:4
38)
        at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:193)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:1
12)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:8
8)
        at raft.jpct.bones.util.JMEOgreImporter.run(JMEOgreImporter.java:69)
        at raft.jpct.bones.util.JMEOgreImporter.main(JMEOgreImporter.java:170)

Can you please help me to find the issue.

Thanks and Regards,
Subha

19
Bones / Ogre to Bones conversion
« on: December 23, 2011, 07:27:18 am »


Hi All,

I am new to JPCT. I am currently trying to convert ogre xml file to bones.

My artist gave me the mesh and skeleton xml file. But in mesh xml, the skeleton link was missing.
 ???
I manually added the skeleton link and when I executed jmeOgre2Bones bat file I got the following error, (Windows7 operating system)

jmeOgre2Bones.bat -out image.group.bones -in my_V008_test.mesh.xml

Skeleton created out of jME OGRE skeleton, 48 joints
Exception in thread "main" java.lang.NullPointerException
        at raft.jpct.bones.BonesImporter.convertJMESkinData(BonesImporter.java:
57)
        at raft.jpct.bones.BonesImporter.importOgre(BonesImporter.java:192)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:
12)
        at raft.jpct.bones.util.JMEOgreImporter.loadGroup(JMEOgreImporter.java:


I like to know,

i) What my artist should do for missing skeleton link in mesh file? Do my artist need to do anything while exporting the data from 3d studio?
ii) Why I am getting, NullPointerException while convertJMESkinData

Thanks in Advance.

Regards,
Subha

20
Support / Re: Need to drag an 3D object based on touch
« on: November 24, 2011, 02:05:11 pm »
Hi Egon,

Thanks a lot. I am able to move the objects.  :D

Regards,
Subha

21
Support / Need to drag an 3D object based on touch
« on: November 23, 2011, 07:30:41 am »
Hi,

I have a requirement where I have to drag the object based on user touch movement (basically touch & drag). Based on the topic Picking, I am able to identify if an object is touched.

My understanding to achieve drag is the object must be translated based on touch coordinates.

I understood how to get 3D to 2D coordinates and viceversa. I am unable to understand,

i) how to co relate this to translation?

ii) How the screen width and height is translated to translate factors,

when I tried

object.translate(-100,100,0); the object was not seen. I tried by trial and error and found translate x should be in range of -30 to +30 and y in range of  -45 to +45.

I did the following Math calculation on Touch listener

if (me.getAction() == MotionEvent.ACTION_MOVE) {         
           
         xpos = me.getX();
         ypos = me.getY();
         if(sphereclicked) // if the object is clicked
         {
         SimpleVector touchvector =
            Interact2D.reproject2D3DWS(world.getCamera(), fb, (int)xpos, (int)ypos).normalize();

         sphere_vector = Interact2D.projectCenter3D2D(fb,sphere); // sphere is the 3D object
         
         if(diff == null)
         {
            diff = new SimpleVector();
         }
         diff.x = ((sphere_vector.x) - xpos)/-10.5f; // this is also trial and error , I didnt understand the Math behind it :(
         diff.y = ((sphere_vector.x) - ypos)/-10.5f;
         diff.z = 0;
         
             Log.i("HelloWorldJPCT", "diff : %d %d %d" + diff.x+ " "+
                   diff.y+" "+ diff.z);
           
         }

And on Draw Frame,

if(sphereclicked == true)
         {
            if(diff!=null)
            {
                sphere.clearTranslation();
                sphere.translate(diff);
            }
         
         }

But after this code, object moves in y-axis and x-axis. But in negative y-axis, the object doesn't move till the end of the screen. The same with x-axis, it never moves till the end of X-Axis.

I am attaching my code for your reference. Please help me to understand the concept behind this. How to relate the touch cordinates to translate for an object.

Thanks in Advance,

[attachment deleted by admin]

Pages: 1 [2]