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

Pages: [1]
1
Support / Re: Problem with transparent textures
« on: April 22, 2011, 02:48:30 pm »
Importing in two separate Object3D worked. But is that the only solution?
I'll look for the threads, btw. Ty, as always.

2
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?

3
Support / Re: Moving and rotating the cam
« on: April 21, 2011, 11:19:31 am »
That helped a lot, ty Egon.

4
Support / Re: Moving and rotating the cam
« on: April 20, 2011, 05:37:48 pm »
Hi, I solved with a really simple check:
Code: [Select]
SimpleVector rotation=this.getDirection();
rotation.y=0; //I don't care about y angle, for now at least
rotation.normalize(rotation);

direction=s;
direction.y=0;
direction.normalize(direction);
float f=(direction.x-rotation.x); //This is the really clever check :D
float angle=direction.calcAngle(rotation);
if ( !(angle>-0.03f && angle<0.03f) ) {
    this.rotateCameraAxis(this.getYAxis(), Math.signum(f)*speed);
} else {
    this.turning = false;
}

Ty all for support.

EDIT: nope, isn't really working as expected :\

5
Support / Re: Moving and rotating the cam
« on: April 20, 2011, 12:36:12 pm »
The problem subsists because I do that step by step. All the information I get (but it's probably my fault) is that my position has an angle of, let's say, 15° with the destination, but calcAngle() tell me 15° even if the angle is 345°.
I rotate the cam with something like that
Code: [Select]
this.rotateCameraAxis(this.getYAxis(), speed);I would like to rotate with -speed if the angle is > of 180°.
Any suggestions?


 

6
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.


 

7
Support / Re: Extending Camera Class
« on: April 19, 2011, 09:52:02 am »
I got it working using Egon solution, but just for simplicity. Kaiidyn's one is working too.
Thanks for the great support you all offer in this forum.

8
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.





9
Support / Re: Creating an object where i click
« on: April 04, 2011, 09:21:06 am »
Ty much for your answer, Hrolf.
.getCenter() of my cloned object it's at (0,0,0), so i thinks its fine.
Btw, I switched to setOrigin() instead of .translate().
However, now all cloned objects lay on the plane, but still in wrong position.
If I rotate the camera in a certain direction (let's say east) i get consistent results, but all objects are more distant than the point I clicked.  
I really don't have a clue. :(  

EDIT:
resolved with this topic: http://www.jpct.net/forum2/index.php/topic,1932.0.html
ty all!

10
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]