Unity Video Overlay Issues - google-project-tango

I have used the ARScreen.cs script and ar_screen shaders from the AugmentedReality scene provided in getthehub.
The GUI shows perfectly, the background/Video Overlay displays perfectly but everything else draws over the video and stains. Video Overlay and GPU Acceleration options are enabled on Tango Manager, Ux script is enabled but its options are disabled.
Any advice regarding having the 3d objects render normal (exactly like the markups in the unity example project)
Thanks

Solved! Enable Ux script's options, set the culling of the main camera, the camera you are using for your arscreen.cs script to solid color white, and then in the arscreen.cs I commented out the command/call //_UpdateTransformation(timestamp); in my case... apparently the _UpdateTransformation command placed my camera far from the player's object and thus objects were not visible and it seemed as if the video overlay covered my seen.

Related

How to change the camera in three.js / editor using only scripts?

How to change the type of camera used in three.js/editor? I want to do this using scripts, and not using the add camera button (Add → Orthographic Camera). I try to announce the camera again, but I can't. I'm trying to check the view of the main camera using the function (console. log(camera)) — the console shows that the camera has changed. But, when you click the PLAY button, the view remains the same as it was. Thank you for your help and feedback, I am very grateful for this!
It is not possible to do what you are looking for since cameras are handled within the editor. You can't use scripts to change the type of camera used for rendering.
In general, there is no full support for orthographic cameras in the editor. For example the editor's controls only support perspective cameras as well as the app player that playbacks exported/published applications. However, there is a feature request at GitHub that tracks the improvement of orthographic camera support:
https://github.com/mrdoob/three.js/issues/16008

How to disable gyro based rotation on mobile phones

i want to disable the camera rotation, while being on mobile.
I though making look-controls="hmdEnabled:false" would disable moving the camera along with the mobile device, yet it didn't work.
I tried to find which controls should i disable, but i only found some intel stating, that WebVr drivers rotate the scene #HMD orientation, not directly from the gyroscopes.
Nonetheless, I have no idea how to lock the camera, so it can be only moved by dragging Your finger.
Thanks in advance
I packaged up a component that does this at https://github.com/AVGP/a-touch-controls:
<a-scene>
<a-entity camera touch-controls></a-entity>
</a-scene>
These controls are using mouse (click and drag) or finger (swipe) movements to move around the camera, but does not use the gyroscope on mobile, except when explicitely entering VR mode, which still permits Cardboard usage etc.
If you want your own control scheme, you'll need to make your own controls. You can copy and paste some code from the look-controls and customize it: https://github.com/aframevr/aframe/blob/master/src/components/look-controls.js

JavaFX animations are flickering

I have a window displaying a video stream with a twitter feed as an overlay.
When a new tweet is displayed, the current tweet animates out using a rotate animation and the next tweet is rotated into view. The animations are performed using a RotateTransition.
The app also switches between different cameras to display different streams. To give an indication of when the app switches to the next camera, I have a progressbar that fills using a Timeline object.
This works well, until I resize the window. The rotate animations start to flicker, along with the progressbars as they gradually fill.
As a test, I disabled the video stream, to see what's happening. The 'artifact' doesn't occur then and I can resize as much as I want. If I play the stream and don't resize, everything works well.
The video player is based on VLCJ, but the actual pixels are drawn on a WritableImage in an Imageview.
See the following images that illustrate the problem.
At the bottom right you can see 2 different progress bars (a ProgresBar and a ProgressIndicator).
A part of the flickering result is still visible below the second image. It somehow stays visible, probably because the area doesn't get redrawn.
Any idea what makes the flickering happen? Is there anything I can do to fix or avoid this?
I tried some VM options in IntelliJ: -Dsun.java2d.d3d=true -Dprism.forceGPU=true to somehow enable hardware acceleration, but that doesn't seem to help.
Disabling the progressbar fill animation doesn't help either.
I had a similar problem with some arcs and shapes that would flicker when its attributes / sizes were changed.
The solution to my problem was to make sure that the methods used to change the shapes were called from inside the JavaFX thread.
Platform.runLater(() -> {
arc.setStartAngle(30);
arc.setLength(45);
}

How to create auto blur effect on mouse hover

I was browsing the home page of canva.com
I was surprised by the UI effect of hover blur effect on the home screen. How can we develop such a feature on our website. Is it using CSS3 or some other javascript plugin libraries.
Thanks
They use a blurred background image, a canvas and an unblurred version of the image. Moving the mouse 'draws' (a portion of) the sharp image onto an otherwise transparent canvas. This makes it look like some kind of magic, when in reality it's just selectively copying a src image onto a canvas. I imagine a second, off-screen canvas is used to allow the 'drawn' lines to have their opacity faded. This canvas is then used to blend the copied image with the blurred image. Look into "canvas blending modes"

In win32 programming, why can't I see the video in Media Player if I overlay a transparent window (via WS_EX_LAYERED) over it?

I've written an application that overlays a transparent window over the screen. The transparent window is created by applying WS_EX_LAYERED style to it, and calling SetLayeredWindowAttributes(
hWnd,
RGB(0,0,255),
127,
LWA_ALPHA
);
I just run into a problem that when this transparent window is over Media Player that plays a video, the transparent region simply becomes gray and I can't see through it.
Why is that? And what can I possibly do to see the contents of Media Player through the transparent window?
I'm not sure about the following but it is what I believe it may be based on my knowledge.
Usually an overlay surface is created in the rectangle area that plays the video for hardware acceleration purposes and video card controls it (well... an application thru some api like directx controls it)
The overlay surface is draw over, let's call it, the gdi/window surface that usually is painted in black by the application.
And that's why you see the black/grey in the background.

Resources