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

Pages: [1]
1
Support / Problem with transparent textures
« on: April 22, 2011, 10:09:12 am »
Hi.
I load a simple .3ds model with textures. I set the the transparency on the model with obj.setTransparency(quitehighvalue).
seems to work, but i have this behaviour:



Am I doing something wrong?

2
Support / Moving and rotating the cam
« on: April 20, 2011, 09:51:06 am »
I'm sorry but I need your help another time. I'm writing a method that smooth move the cam to a point in the 3Dworld. For now it's frame based, and the trajectory and speed are linear.
Code: [Select]
public void flyTo(SimpleVector s, float speed) {...}The moving part seems to be ok
Code: [Select]
SimpleVector whereIam = this.getPosition();
SimpleVector direction = s; //the point where I have to go
direction.sub(whereIam);
if (direction.length() > PROXIMITY) { //I stop PROXIMITY units before the point
this.moveCamera(direction, speed);
}
but I have problems with the rotating part.
using calcAngle() give me always positive result, so in i have to rotate 15° left, what happens is that I rotate 345° right. Is there a better way to do that? I think using rotation vector, but i don't clearly understand how do they works.
Ty as always,
Bio.


 

3
Support / Extending Camera Class
« on: April 18, 2011, 04:51:41 pm »
I need some method to smooth move my camera to a point in my world. I thought that the right way to do this was extending Camera class.
I did the nearly same thing with the 3DObject class. I added some methods and some fields. And everything works.
But when i do this:
Code: [Select]
myCamera cam = (myCamera)world.getCamera();
I get a Cast Error. I'm not a guru with Java, but I cannot understand why with 3DObject class is working and with Camera is not.
Any suggestion? Maybe a better way to add this functionality to my cam?
ty all.





4
Support / Creating an object where i click
« on: April 01, 2011, 04:34:54 pm »
Hi everyone, i'm using jpct on android since 3 days, and now i'm stuck. I wanna add some object in my world, positioning them where i click. It's probably because i really didn't understand how coords works.
I grab the 3d position with this:
Code: [Select]
SimpleVector dir=Interact2D.reproject2D3D(cam, fb, (int)xpos, (int)ypos, 10).normalize();
float distance = world.calcMinDistance(cam.getPosition(), dir, 10000);

And I clone and position the new object with this code
Code: [Select]
dir.scalarMul(distance);
objs[n] = obj.cloneObject();
objs[n].translate(dir);
world.addObject(objs[n]);

Sometimes objects appears, but at random position (but at the right height, since i click on a plane).
What am I doing wrong?

Thanks for help,
Bio

P.S. Nice work btw with the engine!

Pages: [1]