How to move the Camera in Unity Panorama Street view? - unityscript

↪️ I want to embed a street view in app so I created a new Project
↪️ Added Street View To Skybox from the asset store
↪️ Imorted a street view from google maps to a Skybox
↪️ Drag and droped the sky box in the scene
↪️ how I do move the camera in response to the touch and mouse moment like a panorama in this example
↪️
1.Unit 3d documentation
2.Unity Touch Swipe Camera Rotation - Touch FPS Controller
3.Street View Convert
4.Street view converter unity 3D panorama
5.Unity3D Tutorial: How to make Skybox 360 single texture

I'd do the following:
Create an empty GameObject called "RotorY" which will be responsible for y rotation of your camera (looking around).
Create an empty GameObject "RotorX" as a child of "RotorY". This one will control x rotation (looking up and down)
Make camera a child of RotorX. (also make sure RotorX and Camera have (0,0,0) position in local space)
Add this script to any gameObject and assign rotorY and rotorX to the slots (while experimenting I ended up writing this script, lol)
EDIT January, 2017: added 2 lines in the code to make it work with unity 5.5

Related

Can't see 3D model file in Xcode editor

I want to do some work with ARKit, but when I add .dae or .scn to art.scnassets group in my Xcode project, it doesn't show anything in Xcode 10.1 editor (see the picture), so I can't edit the model. Adding light or other things doesn't help.
Does anyone know how to solve it?
Suppose, you've successfully imported your dae model into Xcode's Scene graph (and this dae model doesn't have flipped poly normals) but you can't see it because your model has no texture.
Here's a simple example of ostensibly empty scene:
But this scene isn't empty. To see what it contains you need to click Show Scene Graph View button at the bottom of Xcode's UI and choose geometry's group in a list.
If you can't still see your whole dae model in Scene graph just press F on a keyboard for framing. And now you're able to assign a jpeg or png texture for your mesh via Diffuse slot of Material's properties.
In your case 3D object is called maze. Just select it, press F on your keyboard to frame your model in Scene graph and then assign a texture via Diffuse slot in Utility area (press Cmd-Alt-0 to activate a Utility area).

Camera rotation lost when i use orbitcontrols three.js

I am developing a web application that uses 3d buildings as models. I want to create a button that places the camera so that the model is in a suitable position, however when I rotate the camera manually the mouse control resets it again.
Sample here:Link
If I enable //controls.update() the rotation doesn't work. With //controls.update() disabled the camera rotate fine but when I use the mouse, the camera is reset.
¿What can I do? Thanks!
You shouldn't directly change the rotation of the camera, instead you should change the position+target.
When you call controls.update() the rotation of the camera will be calculated based on the position of the camera (the location of the camera) and the target of the controls (the location of focus).
For example you can do:
controls.target.set(0,0,1);
camera.position.set(-0.041, 1.9, -1.21);
controls.update();

How do I put an interactable Canvas onto a 3D game object?

Is it possible to place a UI Canvas onto a 3D object? I'd like to create a cash dispenser machine (for example) with a user interface that can be interacted with. Then there will be keycode locks on doors, touchscreen computers, etc.
How can I display a canvas as a 3D object in the 3D world and still have it interactable? Placing it on a Plane would be good enough.
Yes, it is possible. Change Canvas Render Mode to World Space then drag your Camera into the Event Camera slot. You will have to find select the Canvas, press F in Scene View to find it then move it to the place you want it to be.
You need to use World Space UI. Can place anywhere in scene but make sure use can view it in order to interact.
To learn more, watch this video : https://blogs.unity3d.com/2014/06/30/unity-4-6-new-ui-world-space-canvas/

3D Image in Three.js

http://threejs.org/examples/#webgl_geometry_large_mesh
http://threejs.org/examples/#canvas_lights_pointlights
Please see above link. Can anyone please tell how to create and render moving person or statue?
using three.js you can easily create and render moving person or statue
on the first link the statue is no moved , it is done using camera animation(changing the position of camera accoring to the movement of mouse in the canvas)
for a moving person ,you should go for morph animation
morph animation three.js

Threejs Rotating object with device orientation control

I am trying to achieve an effect similar to one of the cardboard app examples that Google has put out with their cardboard app called the 'exhibit'. I have a 3D object that I want to rotate using device orientation control. Right now with just the device orientation control, I can view the 3D object but when I turn around, the camera rotates (it seems) causing the object to fall out of view until I turn all the way back around to where it was in the beginning. In other words the camera seems to rotate in its axis as I look around. What I want is to be able to rotate the object as I turn around.
Kinda like this example http://threejs.org/examples/#misc_controls_orbit except I want to rotate using device orientation control.
Any idea how I can incorporate this feature?
Thank you for your assistance.
The answer to my own question for future seekers is to replace camera in
controls = new THREE.DeviceOrientationControls(camera, true);
with the 3D object you are trying to rotate.

Resources