Locking rotation around Z axis in mobile orientation panorama view with threeJS - mobile

I need your help with ThreeJS, panorama view and Quaternions.
For mobile device orientation panorama view, in a page like this one:
https://richtr.github.io/Full-Tilt/examples/vr_test.html
how would you go about locking the view when rotating around the Z axis (between the use and the middle of the screen), like the way this video does:
https://www.youtube.com/watch?list=PLbsGxdAPhjv_tgCNWGaGvSnlIMZNkmnrM&t=10&v=ClAuhgFQpLo
Please watch on mobile.
Thanks!
Sa'ar

Related

WPF: Minecraft Game Coordinates to WPF Canvas Coordinates

I've been trying to get coordinates from Minecraft and putting them on an WPF canvas for a map viewer. However, most of it does not work and it is not centered. How would you go about with doing this?
Help is appreciated!
Update #1:
I'll be a bit more descriptive of what I want. I'd like to show positions (not images or terrain and stuff) on a WPF Canvas. What I am trying to do is making a navigation system showing lines from certain coordinates to other coordinates. One thing I've tried was making the canvas as big as a Minecraft map, but that didn't work well. https://www.codeproject.com/Articles/85603/A-WPF-custom-control-for-zooming-and-panning I've been using that with no problems, but the thing is that I want to actually translate in game coordinates to coordinates on the maps for waypoints and such.
Sorry for the lack of detail at first!

WPF How to disable rotation of some elements while screen rotate?

I am currently creating Win 8.1 universal app. It should have both landscape and portrait view. But only difference between these two states is, that some elements just "turn" to proper direction, while main grid will not rotate.
I don't have enough reputation so here is link to picture of my notion
Is there any way to disable state change rotation only within some elements or do I have to detect the screen orientation and just rotate the desired elements?
This is rather a simple issue and you should implement your second method:
Identify the elements that should not rotate
Rotate them the opposite direction to the screen

Force a box2d scene to Landscape orientation using XCode

Im developing a game using BOX2D. The plist file is set to support just the Portrait orientation. Game starts in the Portrait mode fine. Im using CCLayer for subclassing. Inorder to switch views or scenes i use the below code.
[[CCDirector sharedDirector] pushScene:[ scene]];
So all I want is to change orientation when loading the views/scenes.
1st View/Scene -> Portrait Mode
2nd View/Scene -> Landscape Mode
3rd View/Scene -> Portrait Mode
Tried few sources but was not of good help. Please help me with this. Any suggestion would be appreciated. Thank You.
It seems to me that you want to rotate the entire scene to 90 degree (- or +) to achieve portrait and landscape for your views. One simple way to do this and not getting sucked into is to create a very small layer as a pivot point that holds all your views at the center of the screen.
Create a very small CCLayer that will act as a viewport. lets call this viewportLayer.
set the position of the viewportLayer to the center of the screen.
add the 1st , 2nd and 3rd view scenes as child of viewportLayer.
after you done the above, whenever you need to go for portrait or landscape mode, all you have to do is rotate the viewportLayer by 90 degree (- or +).
as an additional bonus, zooming in and out becomes an easy solution too. to achieve zooming, all you have to do is scale the viewportLayer and not worry about the children. all the calculations for collision will still work nicely because calculations for those would most likely to be done in child layers therefore not getting effected by the parent transformations.

Zooming on a particular image inside a stackpanel consits of ten images

I have a scrollviewer with horizontal stackpanel having 10 images as children. I need to perform zooming on a particular image which is in view when start the pinch gesture. Is it possible to achieve that. I tried to get the image in a separate layout when start the pinch but it makes the user to start the pinch twice.So kindly help me to get that
Do a click event on the image, then popup a window with a semi transparent background and an image control. Then apply pinch events to zoom and mouse move events to pan.
something like this article:
http://codecopy.wordpress.com/2011/12/15/wp7-pinch-and-pan-zoom-an-image/

Maintain Aspect Ratio in a Silverlight Image

Ok .. so here's the scenario. I've got a WP7 silverlight app, that loads an image from the net. Now, these images will be taken from mobile devices, so they may be in portrait or landscape mode. Certainly not a square.
Is there any way to maintain the aspect ratio when I show these in a silverlight <Image> control?
I'm ok with either of two resolutions:
That the image shows up in its correct aspect ratio within a predefined box that I've defined in xaml
Or that the image is cropped into the square
The way silverlight was built, you can set the width OR the height on the image, it will automatically max out whatever property you set and calculates the other side of the image so that it keeps the aspect-ratio.
So, just set a width on the image and center or right,left,top,bottom align it. (do not stretch it).

Resources