www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: lbb19930915 on December 02, 2016, 09:33:56 am

Title: How can I get the box vertex or someothers represent the 3DObject in world space
Post by: lbb19930915 on December 02, 2016, 09:33:56 am
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?
Title: Re: How can I get the box vertex or someothers represent the 3DObject in world space
Post by: raft on December 02, 2016, 09:51:42 am
the docs (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/Interact2D.html#project3D2D(com.threed.jpct.Camera, com.threed.jpct.FrameBuffer, com.threed.jpct.SimpleVector)) 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
Title: Re: How can I get the box vertex or someothers represent the 3DObject in world space
Post by: lbb19930915 on December 02, 2016, 10:03:18 am
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.... :'(
Title: Re: How can I get the box vertex or someothers represent the 3DObject in world space
Post by: raft on December 02, 2016, 10:21:40 am
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
Title: Re: How can I get the box vertex or someothers represent the 3DObject in world space
Post by: lbb19930915 on December 02, 2016, 11:07:50 am
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.