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 - Uncle Ray

Pages: 1 [2] 3 4 ... 6
16
Support / Re: why the same texture shows different in jpct and 3ds max?
« on: January 31, 2015, 08:09:07 am »
why they looks different?
Any help will be appreciated.

17
Support / Re: why the same texture shows different in jpct and 3ds max?
« on: January 31, 2015, 08:06:16 am »
Object3D a;
TextureManage tm;
a=loader.loadMD2(....);

tm.addTexture("shield", new Texture(Loadassets.Load("FX/texture/shield.png"),true));

a.settexture("shield");

18
Support / Re: why the same texture shows different in jpct and 3ds max?
« on: January 31, 2015, 07:55:30 am »
here is model


here is texture

19
Support / why the same texture shows different in jpct and 3ds max?
« on: January 31, 2015, 07:53:19 am »
solved
Answer:the fbx to obj,have some loss with texture,it is wrong in 3ds max,not jpct
____________________________________________________

here is in 3ds max





here is in jpct

20
Support / Re: May be jpct would add AABBIntersectsAABB
« on: January 27, 2015, 06:25:26 am »
it was in 2d situation,in this way 3d situation will solved not very hard.

AABB check AABB was usefull method in car racing game,may be in next release of jpct will add a AABB check AABB method.

if not?Above code would reached it too.

21
Support / Re: May be jpct would add AABBIntersectsAABB
« on: January 27, 2015, 06:19:49 am »
public SimpleVector[] new_getworldspacebounds(Object3D obj) {
   
   float[] objectSpaceBounds = obj.getMesh().getBoundingBox();
   SimpleVector mins = new SimpleVector(objectSpaceBounds[0], objectSpaceBounds[2], objectSpaceBounds[4]);
   SimpleVector maxs = new SimpleVector(objectSpaceBounds[1], objectSpaceBounds[3], objectSpaceBounds[5]);
   SimpleVector[] p = new SimpleVector[8];
   p[0] = new SimpleVector(mins.x,0, maxs.z); p[1] = new SimpleVector(mins.x, 0, mins.z); p[2] = new SimpleVector(maxs.x, 0, mins.z);
   p[3] = new SimpleVector(maxs.x, 0, maxs.z); p[4] = new SimpleVector(maxs.x, 0, mins.z);
   p[5] = new SimpleVector(maxs.x, 0, maxs.z); p[6] = new SimpleVector(mins.x, 0, mins.z); p[7] = new SimpleVector(mins.x, 0, maxs.z);
   
   for(int i=0;i<8;i++)
   {
    p.matMul(obj.getWorldTransformation());   
   }
   
   return p;
  }

22
Support / Re: May be jpct would add AABBIntersectsAABB
« on: January 27, 2015, 06:18:19 am »
public void sort(float[] a)
{
  float temp=0;
  for(int i=a.length-1;i>0;--i)
 {
   for(int j=0;j<i;++j)
   {
    if(a[j+1]<a[j])
    {
     temp=a[j];
     a[j]=a[j+1];
     a[j+1]=temp;
    }
   }
  }
}






23
Support / May be jpct would add AABBIntersectsAABB
« on: January 27, 2015, 06:17:12 am »
I have done it,may be someone need?
In my project it was worked perfect.
public boolean AABBIntersectsAABB(Object3D obj1,Object3D obj2, Update_trackandcar update,World world)
{
   SimpleVector obj1_0=this.new_getworldspacebounds(obj1)[0];
   SimpleVector obj1_1=this.new_getworldspacebounds(obj1)[1];
   SimpleVector obj1_2=this.new_getworldspacebounds(obj1)[2];
   SimpleVector obj1_3=this.new_getworldspacebounds(obj1)[3];
   SimpleVector obj2_0=this.new_getworldspacebounds(obj2)[0];
   SimpleVector obj2_1=this.new_getworldspacebounds(obj2)[1];
   SimpleVector obj2_2=this.new_getworldspacebounds(obj2)[2];
   SimpleVector obj2_3=this.new_getworldspacebounds(obj2)[3];

   
   SimpleVector obj1_front=new SimpleVector(obj1_0.x-obj1_3.x,0,obj1_0.z-obj1_3.z);
   SimpleVector obj1_left=new SimpleVector(obj1_0.x-obj1_1.x,0,obj1_0.z-obj1_1.z);
   SimpleVector obj2_front=new SimpleVector(obj2_0.x-obj2_3.x,0,obj2_0.z-obj2_3.z);
   SimpleVector obj2_left=new SimpleVector(obj2_0.x-obj2_1.x,0,obj2_0.z-obj2_1.z);
   obj1_front.normalize();
   obj1_left.normalize();
   obj2_front.normalize();
   obj2_left.normalize();
   
   
   
   
   
   float distance1_z0=obj1_0.calcDot(obj1_front);
    float distance1_z1=obj1_1.calcDot(obj1_front);
    float distance1_z2=obj1_2.calcDot(obj1_front);
    float distance1_z3=obj1_3.calcDot(obj1_front);
    float distance1_z00=obj1_0.calcDot(obj2_front);
    float distance1_z01=obj1_1.calcDot(obj2_front);
    float distance1_z02=obj1_2.calcDot(obj2_front);
    float distance1_z03=obj1_3.calcDot(obj2_front);
   
    float distance1_x0=obj1_0.calcDot(obj1_left);
    float distance1_x1=obj1_1.calcDot(obj1_left);
    float distance1_x2=obj1_2.calcDot(obj1_left);
    float distance1_x3=obj1_3.calcDot(obj1_left);
    float distance1_x00=obj1_0.calcDot(obj2_left);
    float distance1_x01=obj1_1.calcDot(obj2_left);
    float distance1_x02=obj1_2.calcDot(obj2_left);
    float distance1_x03=obj1_3.calcDot(obj2_left);
   
   
   
    float[] distance1_z=new float[4];
    distance1_z[0]=distance1_z0;
    distance1_z[1]=distance1_z1;
    distance1_z[2]=distance1_z2;
    distance1_z[3]=distance1_z3;
    float[] distance1_z_00=new float[4];
    distance1_z_00[0]=distance1_z00;
    distance1_z_00[1]=distance1_z01;
    distance1_z_00[2]=distance1_z02;
    distance1_z_00[3]=distance1_z03;
   
   
   
    float[] distance1_x=new float[4];
    distance1_x[0]=distance1_x0;
    distance1_x[1]=distance1_x1;
    distance1_x[2]=distance1_x2;
    distance1_x[3]=distance1_x3;
   
    float[] distance1_x_00=new float[4];
    distance1_x_00[0]=distance1_x00;
    distance1_x_00[1]=distance1_x01;
    distance1_x_00[2]=distance1_x02;
    distance1_x_00[3]=distance1_x03;
   
   
   
   
    float distance2_z0=obj2_0.calcDot(obj1_front);
    float distance2_z1=obj2_1.calcDot(obj1_front);
    float distance2_z2=obj2_2.calcDot(obj1_front);
    float distance2_z3=obj2_3.calcDot(obj1_front);
    float distance2_z00=obj2_0.calcDot(obj2_front);
    float distance2_z01=obj2_1.calcDot(obj2_front);
    float distance2_z02=obj2_2.calcDot(obj2_front);
    float distance2_z03=obj2_3.calcDot(obj2_front);
   
   
    float distance2_x0=obj2_0.calcDot(obj1_left);
    float distance2_x1=obj2_1.calcDot(obj1_left);
    float distance2_x2=obj2_2.calcDot(obj1_left);
    float distance2_x3=obj2_3.calcDot(obj1_left);
    float distance2_x00=obj2_0.calcDot(obj2_left);
    float distance2_x01=obj2_1.calcDot(obj2_left);
    float distance2_x02=obj2_2.calcDot(obj2_left);
    float distance2_x03=obj2_3.calcDot(obj2_left);
   
   
    float[] distance2_z=new float[4];
    distance2_z[0]=distance2_z0;
    distance2_z[1]=distance2_z1;
    distance2_z[2]=distance2_z2;
    distance2_z[3]=distance2_z3;
    float[] distance2_z_00=new float[4];
    distance2_z_00[0]=distance2_z00;
    distance2_z_00[1]=distance2_z01;
    distance2_z_00[2]=distance2_z02;
    distance2_z_00[3]=distance2_z03;
   
    float[] distance2_x=new float[4];
    distance2_x[0]=distance2_x0;
    distance2_x[1]=distance2_x1;
    distance2_x[2]=distance2_x2;
    distance2_x[3]=distance2_x3;
    float[] distance2_x_00=new float[4];
    distance2_x_00[0]=distance2_x00;
    distance2_x_00[1]=distance2_x01;
    distance2_x_00[2]=distance2_x02;
    distance2_x_00[3]=distance2_x03;
   
   
   
    this.sort(distance1_x);
    this.sort(distance1_z);
    this.sort(distance2_x);
    this.sort(distance2_z);
    this.sort(distance1_x_00);
    this.sort(distance1_z_00);
    this.sort(distance2_x_00);
    this.sort(distance2_z_00);
   
   
   
   
   
   
   
   
   
   
    if(
       (distance1_x[0]>distance2_x[3])
                   ||
        (distance1_x[3]<distance2_x[0])
                   ||           
        (distance1_z[0]>distance2_z[3])
                   ||
        (distance1_z[3]<distance2_z[0])
                   ||
        (distance1_x_00[0]>distance2_x_00[3])
                   ||
        (distance1_x_00[3]<distance2_x_00[0])
                   ||           
        (distance1_z_00[0]>distance2_z_00[3])
                   ||
        (distance1_z_00[3]<distance2_z_00[0])
    )
   
    {return false;}
   
   
    else return true;
}

24
Support / question?where is checkForCollisionEllipsoid's collidecenter?
« on: January 12, 2015, 05:15:49 pm »
solved
Answer:the fbx to obj,have some loss with texture,it is wrong in 3ds max,not jpct
____________________________________________________


obj.checkForCollisionEllipsoid(sv,eclips,6);

where is the eclips's center?
A:the center of obj?
B;the center of obj.mesh.getboundingbox?



and more question how to set the eclipse's center?
A:obj.setCenter(new Simplevector(x,y,z));
the (x,y,z),are coordinate in world's space or object's space?

25
Support / Re: setRotationPivot and 3ds max.
« on: December 29, 2014, 02:53:25 pm »
I want the object rotate with the center of the object.
when i use rotateX(),it was rotate with the point which is near but not exactly the center of the object.
Because in my project the object must be moved,so i can not set a SimpleVector(x,y,z) to be a rotationpivot.How can i setRotationPivot?

In fact,when i use rotateX(),the object was rotate with file's x-axis,not the object's x-axis.

26
Support / Re: setRotationPivot and 3ds max.
« on: December 29, 2014, 02:14:33 am »
sorry,is there can see now?

27
Support / Re: setRotationPivot and 3ds max.
« on: December 28, 2014, 09:54:23 am »
file's pivot's original is (0,0,0),
and object's pivot's original is the center of object.

28
Support / Re: setRotationPivot and 3ds max.
« on: December 28, 2014, 09:50:13 am »

29
Support / Re: setRotationPivot and 3ds max.
« on: December 26, 2014, 10:38:56 am »
and Config.useRotationPivotFrom3DS=true;

it's just the file's pivot,

not the pivot of the object.

i just need the object's pivot which is differrent to file‘s.

30
Support / setRotationPivot and 3ds max.
« on: December 26, 2014, 09:39:16 am »
if i changed the model's pivot in 3ds max,and saved as md2(for example new.md2)


when i uesd new.md2 in jpct,the Objec3d A,which loaded new.md2.

question:
1:A's pivot is the old pivot,or the new pivot which i modified in 3ds max?

2:if i want to use the new pivot which 3ds max created,how?
 


Pages: 1 [2] 3 4 ... 6