jPCT-AE - a 3d engine for Android > Support

Scaling on different devices

<< < (3/3)

EgonOlsen:
No, it won't work that way. What you want to use is the method that takes the z-value in addition to x and y.
Unfortunately, there's no variant of reproject2D3DWS that supports this. However, you can do something like this:


--- Code: ---SimpleVector ray = reproject2D3D(camera, buffer, x, y, <your depth (20?)>, <vectorToFill>);
ray.matMul(camera.backMatrix.invert3x3(<matrixToFill>));
return ray;

--- End code ---

What you did (except for not using the world space methods) is to cast a ray through the point (x3d, y3d, 1) and taking the coordinate at a length of 20. That's not the same thing (as you have noticed already....).

rushtone:
ahh ok i see.. i was thinking it the same like a translation.. i get a direction vector. multiplying it with the distance and it should be the point where i projected my ray to. im still a bit confused i must admit.

egon as i saw you are able to speak german on other forums.. you are properply a german?
is english the desired language here or can i talk in german with you? might be easier.. at least for me.. ;)

what i tried with my attempt above was to figure out where my visible bounds are.
i wanna spawn enemys just a little distance outside the visible area.
since i move my ships equally on z and y axis..
i could take the value of the screen height divided by 2 as this z parameter.
or what kind of z does this method you suggested is expecting? z of the world coords i guess?
if i could use the half height of the screen size. im fine i think. couldnt test it yet..
my wife doesnt want me to go onto the pc today.. ;)

im honest this is my first 3d project. i guess my questions are totaly newbish. so im sorry if that is the case. i try to learn as much as i can.

EgonOlsen:
There's a "german corner" for discussions in german: http://www.jpct.net/forum2/index.php/board,6.0.html

Stell deine Frage einfach dort nochmal kurz.

Navigation

[0] Message Index

[*] Previous page

Go to full version