Author Topic: How can I get the box vertex or someothers represent the 3DObject in world space  (Read 14355 times)

Offline lbb19930915

  • byte
  • *
  • Posts: 7
    • View Profile
I use jpct-ae for AR 3D rendering base on Lbs.There are two questions confused me.Could some one help me?
Now I need to check  if a AnimationGroup is showing on the android screen.If not showing can I get the Position even if it is out of Fov(instead of null..)?Because I need to make a Indicator to indicate the position of the 3DObject.
Now I have known how to transform a Point in world space to screen space. I use the following code .
 SimpleVector bottomP =  Interact2D.project3D2D(cam,fb,ninja.getRoot().getCenter());//how to avoid botoomP be null,even if it is out of Camera Fov?
The question is how can I get someting like a Rect or a box or anyother useful vertex to represent the 3dObject position?

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
the docs say, that method returns null only when the point is behind viewplane, not outside of FoV.

Egon can clarify it.

anyway, one option may be to "remember" the last non-null value

Offline lbb19930915

  • byte
  • *
  • Posts: 7
    • View Profile
Dear Moderator,thank you for respond me. But how can take some vertex to represent the 3DObject?I don't really know what the meaning of view plane.... :'(

Offline raft

  • Moderator
  • quad
  • *****
  • Posts: 1993
    • View Profile
    • http://www.aptalkarga.com
Quote
Because I need to make a Indicator to indicate the position of the 3DObject.
if you need to show indicator even if object is not visible, remembering last position may be a good option

Quote
The question is how can I get someting like a Rect or a box or anyother useful vertex to represent the 3dObject position?
do you need representation in 3d world or on screen? for 3d world you can use AnimatedGroup.getRoot() as you already doing, place any box or whatever you want to that position. for more accurate representation you can calculate and use center of group. or you can calculate a bounding box which the whole group can fit into.

Quote
I don't really know what the meaning of view plane
view plane is the imaginary screen plane where obejcts in 3d world are projected onto. essentially the view plane should be between the camera (eye) and the object othewise the object can not be projected. in real life you cannot see anyhthing behind your eye lense, right? just like that

Offline lbb19930915

  • byte
  • *
  • Posts: 7
    • View Profile
Thank you sir. My English is not very well,but I will try my best to let you can read...
Firstly,I can save the last not null position,I will have a try.thank you ~
Secondly, I have no mean of what size of box should I make,or just the height of box in the world space is enough.
Thirdly, what  you said is very brief and clearly.thank you sir.