A-frame mobile scaling - three.js

I can't seem to figure out why the mobile view of a-frame camera aspect ratio is completely off. it's scaled so everything looks skinny in portrait mode and wide in landscape. I am also getting this error in console:
dpdb.js:79 Failed to recalculate device parameters.
I've adjusted the CSS and set the canvas width/height on a settimeout after it renders. Any way around this issue?

Related

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);
}

User taken to bottom of page on rotation

I've come across an issue present on IPad and IPhone 6. When the user is at the middle of the page and rotates from landscape to portrait they are taken to the bottom of the page. After a lot of looking around into the issue I found that I could fix the issue using the viewport meta tags. I am currently using:
`<meta name="description" content="width=device-width", initial-scale=1/>`
When I remove the initial scale the issue is fixed but then the ipad scaling issue occurs where landscape is zoomed in and portrait is not.
Does anyone have a solution?
Use autoLayout and size classes to set your View according to orientation you will not need to look for metadata detail.

iOS 8 UISplitViewController details view resizing incorrectly when rotating to landscape and overlay visible

Got another issue with UISplitViewContoller on iOS 8.
When in portrait, and the displayMode is UISplitViewControllerDisplayModePrimaryOverlay, when you rotate to landscape the secondary view controller's view doesn't resize correctly during the rotation animation. Once the rotation is done, the size is adjusted to fit the screen space and it snaps into place which is quite jarring.
However, if the display mode is UISplitViewControllerDisplayModePrimaryHidden when the rotation occurs, the secondary view's size is adjusted during the rotation animation and everything looks and works as expected.
This occurs even with the out of the box Master-Detail template project from Xcode 6.1.
Any thoughts on how to get the secondary controller's view to size correctly during the animation when the primary overlay is visible?

Unity 4.6 GUI with rendertexture for upscaling - events in wrong location

I am trying to use the new 4.6 Unity GUI system to create a bit of UI. I want to make this UI at a resolution of 400x300, then render to a texture which will then be drawn to the screen at a resolution of 800x600 (so double resolution). The problem is this: It doesn't work. The rendering is okay and I can correctly upscale the render texture and have it drawn to the screen, but the UI events aren't received in the correct position, and I can find no way to get around this.
So:
Player resolution is 800x600 Render texture resolution is 400x300
Main camera, called "UI Camera" renders to this texture (at 400x300)
Canvas set to "Screen Space - Camera" pointing at "UI Camera". Under this is a button which is set to stretch to all sides (so fullscreen, 400x300)
A second camera, called "Upscaling Camera".
Another canvas set to "Screen Space - Camera" pointing at "Upscaling Camera".
This canvas has it's GraphicRaycaster component removed. Under this is a RawImage displaying the render texture.
When I play, the UI is correctly rendered to the rendertexture, and then displayed on screen at 2x resolution, filling the screen. What is not working is the events - the button can only be interacted with when the mouse is in the lower-left quarter of the screen.
Conceptually, this makes sense. The button is occupying a space from (0, 0) to (400, 300) (starting at the bottom left of the screen), and now my player's resolution is 800x600, this rectangle only covers the bottom left corner. I get that.
So, with all that said, what can I do to fix this? I can't set the EventCamera on the GraphicRaycaster, so that's out. My next thought was to be somehow fudging the mouse positions. But honestly, I have no clue where to go.
(And in case somebody has a better way of doing this - I'm looking at a game working in 400x300 resolution which needs to be pixel-perfect. If I were to resize all my UI externally, that would mean that in-engine, they are essentially running on a half-pixel grid. Same goes for using the CanvasScaler component.)
Cheers for any help.

Images rotated on chromecast

I have a Chromecast sender application developed. I try to take a photo in portrait mode with my phone camera. When I try to send it to the Chromecast device, I see it rotated 90 degrees.
This occurred on Samsung Note S3. On Nexus 5, it was showing in portrait mode. I have tried similar applications downloaded from the Google Play and the results were different. Some apps had the same issue while others could cast the photo in its correct orientation.
On another note, Is there a way to have a smooth transition between photos? currently I have the Default receiver app installed and the fade out is working fine. However, new images loads in chunks ... any suggestion on how to fix this?
Thanks
You can create a custom receiver and use CSS to fade between images. Create a div with two image tags and set the CSS style for the div to:
-webkit-transition: opacity 3s linear;
Then use Javascript to toggle the opacity of the images:
image1.style.opacity=0;
image2.style.opacity=1;

Resources