We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
Like what I said in the title. I create a 3D box in a 3D coordinate system, then I change the camera setting to see from different angels. On my screen (absolutely it's 2D), the box appears at different positions. I'd like to get it's center pointer position on the screen displayed by x and y just like a 2D drawing. Any ideas?
Thank you
Answers
you want to look ar screenX and screenY
or modelX and modelY
Hi Chrisir,
Thank you for your new instructions, I tried screenX and screenY. The issue here is it looks like the 3D pointer will always be map to a constant 2D plane. So no matter what I change the position of the camera, it always map to a fixed 2D position.
When I disable the camera and use translate to make the box move, that is really what I want, the correct position of the box on my 2D window. So my question is do we have any method to map the 3D pointer on my camera view 2D plane. That should already be done somewhere. That's how the shape been drawn on my screen, right?
Max
No really, screenX and screenY are what you want. Example:
I checked your code and plus the camera, It looks good and I don't know why it doesn't work the last time. Maybe I messed up with the 3D position of the point I want to detect. Thank you so much for your help and example codes :)