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.


Topics - luozi

Pages: [1]
1
Support / how to caculate the angle between the SimpleVector
« on: November 06, 2011, 02:54:55 am »
I want to caculate the angle between two SimpleVectors, I using the following code:
SimpleVector sp=new SimpleVector(0,1,0);
float angle=sp.calcAngle(new SimpleVector(0,0,1));
Logger.log("angle is "+angle);

I thought the angle should be 90, but the  output "angle is 1.5707964", is there something I misunderstand? Thank you!

2
Support / how to load the model
« on: November 02, 2011, 07:58:22 am »
I want to create a sphere with texture coordinates, so I download the terra.asc. I load the file, and when I start it , it stop unexpectedly. I try many times, but it still doesn't work, can any one help me?
Code: [Select]
try {
model = Loader.loadASC(new FileInputStream("/assets/terra.asc"), 4, true);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

model.setTexture("texture");
model.strip();
model.build();
world.addObject(model);
by the way, is there something wrong with the following code, I load the model using that fist, but when I use this function , the program will stop unexpectedly, thank you.
Code: [Select]
public InputStream loadf(String fileName)
{

AssetManager am=getResources().getAssets();
try{
return am.open(fileName,AssetManager.ACCESS_STREAMING);

}
catch(IOException e){
return null;

}
}

3
Support / Why the texture don't wrap the object completely
« on: October 29, 2011, 10:51:37 am »
I compile the example of the helloworld_ae, but when the cube display on the screen, there is some place that is entirely transparent as if there is no texture on it. I thought it was beacuse the cube.caltexturewrapsherical(), then I change it to cube.caltexturewrap(), but this time it was like that the texture is changed to default

4
Support / How to calculate the reflect vector
« on: October 26, 2011, 02:37:13 pm »
I am trying to imlement a program that object A hits B, and then A goes  in the direction of the reflect vector.  I add a collisonlistener which can return the ID of the polygon that was in collision. Then I use  the object3D's function get the polygon's  normal. Now, I want to calculate the reflect vector. Is there a convenient method for this? By the way I don't entirely understand the function in the SimpleVector :     SimpleVecor rotate(SimpleVector rot).  Can you explain how the vector rotate, and how the rot give the  angle of the rotate? Thank you very much!

5
Support / How does the collision detection work
« on: October 25, 2011, 03:56:22 am »
Hello everyone, recentlly I'm intrested  in the jpct. I find it is very convenient, but when I use the collison detection I met a strange problem.
I create two spheres, one big, one small. When the small one is outside the big one, the collison detection works well, the sphere stoped when collison took place. But when the small one is in the center of the big one the small sphere goes through the big one as if the collisione never. took place.Then I create a plane and both side work well. I'm wondering whether I set something wrong or not. Can anybody give me a help?

Pages: [1]