I’ve been trying to figure out how to take a screenshot when using AR. The point is to include the virtual entities in the photo/screenshot. So for example, you can place a tree or a car on your desk and take a photo/screenshot with the said tree or car.
Unfortunately, it seems that I am stuck at the very beginning. I’ve created a small UI element, a 2d screen with a text that says “Take Screenshot”.
It seems that the UI Text element is considered a “pc.ElementComponent.” So looking at the docs pc.ElementComponent it should have a " touchstart" event.
Before worrying about taking a screenshot, I just want to display an alert when the UI Element with the text “Take Screenshot” is tapped but it doesn’t work and I’m not really sure what I’m doing wrong.
To subscribe to mouse or touch events on a UI element you need to check the Enable Input property on your element component, and then use the following event handler:
So, continuing with this topic, my next step is to try capture a screenshot including both the virtual elements placed in the canvas and the camera feed.
I have taken the code from this project: capturing a screenshot and this is what I have:
Now, I was probably a bit naïve thinking I could just do this, and sure enough, the screenshot only captures the virtual elements, but it does not capture the camera feed.
What would I need to look into to capture both the camera feed and the virtual elements? For example, I want to place some cubes and my desk and take a screenshot.
Thank you Leonidas. Thankfully 8th Wall provides a camera pipeline module that can generate a screenshot (including camera feed and virtual objects) so I don’t have to result to implementing separate DOM elements.
In case anybody reads this thread, here is my code. It takes screenshot when user taps the UI button. Note, there is probably a better way to write/implement this, but this is what works for me at the moment.
Hi,
Im actually trying to detect a business card. The image of the card is not stored in the 8 th wall. Initially the 8th wall camera has to be turned on and when any random card is displayed, 8 th wall has to know that it detected a card , but not a toy or phone. Once it detects a card I want to display a message saying that card is detected. Can anyone suggest me how to achieve this. I am thinking of doing canny edge detection , but dont know how to do this in 8 th wall