Is Apple's documentation on ARCamera.transform orientation backwards? - documentation

I'm having a hard time grasping the Apple documentation regarding the ARCamera.transform.
Excerpt:
In camera space, the x-axis points to the right when the device is in UIDeviceOrientationLandscapeRight orientation—that is, the x-axis always points along the long axis of the device, from the front-facing camera toward the Home button.
Okay, so the positive x-axis points to the right, towards the Home button, when we are in landscape right...
But the documentation for UIDeviceOrientationLandscapeRight says:
The device is in landscape mode, with the device held upright and the home button on the left side.
So in landscape right, the Home button is on the left. This contradicts the statement that the Home button and positive x-axis point to the right.
What am I missing? Are the docs wrong? Do they intend to reference the documentation of UIInterfaceOrienation.landscapeRight?

Looks like they've fixed their documentation for UIDeviceOrientationLandscapeRight:
The device is in landscape mode, with the device held upright and the Home button on the right side.

Related

how to set frustum inortographic camera THREEJS

First to thank for the great support you allways have provided me.
I have modified the SelectionBox and SelectionHelper modules published in threejs in order to work with instances.
The point is that if I try to use it with an orthographic camera the selection is not accurate. It works properly with a perspective camera.
Note:
In order to enable|disable area picking just double click left mouse button.
In order to test the code with an orthographic camera just comment perspective camera initialization and uncomment orthographic camera initialization in init function.
Here my fiddle:
enter code herehttps://jsfiddle.net/6f3gx8hb/
In perspective camera it works fine but not in ortographic camera
Best regards

Replicating Camera View - DeviceOrientationControls to TrackballControls

I am trying to replicate a view from a phone (using DeviceOrientationControls) to a desktop (using TrackballControls). I am passing the view state (camera position & direction) through an intermediary server, and have that part mostly working.
I'm having trouble setting the camera rotation on the desktop. The cameras are sync'd to look at the same point, but the view on the desktop (receiving the view state from the phone) rotates around the view angle.
I definitely don't fully understand quaternions or rotation order. I've tried applying those, but clearly I'm out of my element. I guess I'm just looking for some hints on how to sync the camera rotation on the desktop.
Looks like I had a (trackball) controls.update() in my animate() that was blowing away the rotation that I was setting. Camera position and direction are not changed by this, but the rotation (or the "roll" of the camera) was.
In TrackballControls, it would be nice to have a setting for programmatically updating the camera's rotation that wouldn't get squashed by a call to rotateCamera(). I'll have to think about that, because it doesnt seem like it would be easy to implement.

Camera constraints on Verold

There is a problem that multiple users of my model have noticed, namely that when you right click the model (here), the movements are hypersensitive. Orbit and zoom are fine and steady, but pan now more often than not results on the model rapidly shooting off into the distance. I've been playing with the camera controls to no avail and I don't want to simply remove the pan option for the client.
Also, is there any way to transition between cameras without a fade, just a movement of the camera?
Also, Verold not working on Internet Explorer 11... any news?
Thanks
Solved: problem was the focal point (white lined sphere). Had been set off accidentally far off into the distance (can be easily done without noticing and there is no undo). Just brought it back to the object.

Cocos2d - 4inch screen displace the game

i developed a game for the iphone4. Now i got problems with the iphone5 and the 4inch screen. My game is on the left side of the 4inch screen and i have a big black border on the right side. But the buttons from the game are in the middle of screen, they have same position like on the iphone4. I checked everythin but i dont know why the background-images and the sprites are on the left side and the buttons are in the middle. I want that everything is in the middle or on the left side. It would be great if anybody could help me!! Thanks!!
COCOS2d-iPhone:
If you're using the latest beta, the only change you should need to
make is export all your images at twice the size and use the "-hd"
suffix, similar to Apple's "#2x". The documentation also says you need
to set the content scale factor of the director.
You can find the documentation here.
and more detail here.
COCS2d-X:
Cocos2D-x has a very easy solution for multi-resolution problem.
In fact you just need to set your DesignResolution and then just imagine your target device will has this resolution.
If target device really has this resolution ( or some other but with same ratio) cocos2d will handle to fix screen and your game looks same in all devices.
And when ratio of target device is different, you have many option ( as cocos2d language, policy) to manage that.
For example if you use Exact fit policy, cocos2d will force your game ( and design) to fit target device screen (without that black boarder).
Exact fit
The entire application is visible in the specified area without trying
to preserve the original aspect ratio. Distortion can occur, and the
application may appear stretched or compressed.
For more detail just take a look at this link : http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Multi_resolution_support

Restore MKMapView visible state/region properly

I have a little iPad app which shows a MKMapView instance (map). In order to save the state I try saving the map.region to the NSUserDefaults. This works very well storing only the single values as doubles. On launching, the app combines the numbers and produces a valid MKCoordinateRegion. This happens in application:didFinishLaunchingWithOptions:. Now there are several problems.
1) Imagine: You leave the app in landscape orientation. The app saves the corresponding MKCoordinateRegion. The app is terminated. Now, holding the iPad landscape, launching the app, the map doesn't show the same state as before leaving the app. And no, this is not a problem of regionThatFits:. I tracked it down and this is what happens: Also when it isn't visible to the user, the app starts in portrait mode. The app restores his state. After that the map is rotated into landscape mode.
With other words the app saves the landscape state but restores it to portrait. If you repeat these steps the map zooms out with every launch. Not the best UX.
2) Even if problem one would be solved by restoring in the right orientation there is still the problem that the launching orientation could differ from the leaving orientation. I think one of the better ways to solve this is to store always the values for the portrait orientation also when the user leaves in landscape. By doing this the state would be restored properly because the app is launched initially in portrait by the system.
One possible way would be to change the latitude/longitude values if the app is left in landscape. But this would be too inaccurate because CLLocationDegrees differ if they are latitude or longitude.
An other way (and I think this would be the best way) would be to "simulate" a rotation of the mapview or to calculate the visible region for the portrait mode when the app is left. But I really don't know how to do this. Here is the point where I need your help and your ideas.
I appreciate every ray of hope. :) — And please tell me if I think into a wrong direction.
Hmm. If I understand your question correctly, you're saving the MKMapView's region (that is, its center and span), and would like to use these values to restore the map's center and zoom level, independently of whether the user rotates the device between sessions.
Have you tried calculating the width-to-height ratio of your map rectangle, and then multiplying out the changes to the span? That is, if your map has bounds of size 800 x 600 in landscape mode, then you'd multiply the longitudeDelta by 600/800 (0.75) and the latitudeDelta by 800/600 (1.33) to get the appropriate span for a 600 x 800 rectangle in portrait mode.