How to move the camera around with gestures in RealityKit? - realitykit

In SceneKit when you have a scene you can use gestures to move around the 3D space. How can you do this in RealityKit (using non-AR), or is it not possible? I am using SwiftUI as well.

Related

Keep ThreeJs sprite looking at Mapbox camera

How can I keep my sprites facing the Mapbox gl camera?
To do this, I assume I need access to the Mapbox camera position - however, I don't know how to access this from inside the Three.js scene.
Any ideas?

How to setup exactly same two 3d viewport

First of all, sorry for my english
I have two 3d viewport, the first one for editing and the other for live render. The problem is i need to orbit again so they have same viewing angle. So is there any other way to do it more easily?
If you have both 3D viewports showing the camera view numpad 0 you can enable Lock Camera to View and both viewports will show the same movement. You can find the lock to view option in the View panel in the properties region N. You only need to lock the one viewport that you will be using to move around in.
As this will actually move the location of the camera, you may want to have a second camera to use for this and switch the active camera between your viewport and rendering camera in the scene properties.

Animated Sprites blocked by Canvas in Unity

I have managed to animate a series of sprites by dragging a group of sprites into the Hierarchy. However, when I enabled the Canvas, the Canvas was blocking all the sprites. What should I do to display the animation on the Canvas? I have tried adjusting the layers and camera modes, but to no avail.
I'm not sure if I understood your question correctly, but I understand that you want your sprites to be displayed on top of the UI. You can use 2 cameras and adjust their depths so that one of them displays the layer of the animation (make this one the top camera) and the other one displays the UI layer.
Use Culling Masks in Camera
How to use Multiple Cameras

How to drag the scene in four direction using mouse?

Right now the whole the scene is rotating when moving the scene to left/right/top/bottom. I want to drag it in four directions.
http://arkatest.com/bbmap/map/test1.html
http://pastebin.com/KqQe1LhL
You are using the trackballcontrols to manipulate the camera movement. The trackballcontrols has a pan functionality but it is triggered when right clicking with a mouse. This functionality is not configurable.
A very quick hack to enforce this would be changing this line to
_state = STATE.PAN;
A better way would be to create a PR to three.js to make this mouse inputs configurable.

Unity3D: Sprite renderer vs image renderer issues on canvas

I'm using sprites for an animated menu in my game.
I tried two methods:
Image Renderer: Replacing the image per frame with the sprite slice in the animation window
Sprite Renderer: Same method
I'm playing the sprite animation with no loop then rotating the transform on the z-axis.
The problem is that with the image the Screen Space overlay works well but the rotation of the transform causes the sprite to look glitchy and rough. With the sprite renderer however the Screen Space must be put to Camera and the sprites get placed between other assets in the world.
Example: http://postimg.org/image/436q9jvax/
Is there a way to either fix the roughness on the rotation using image or force the Camera Screen Space on top? My only concern with the 2nd option would be in relation to responsiveness for multiple devices.
The easiest fix was to apply "sorting layers" to the canvas with the sprite renderers on to keep it on top.
I did however incorporate #beuzel's idea about separate cameras in the end and opted for 2D sprites with physics instead of a 3D rendered animation on canvas.
http://postimg.org/image/6qmtiirb9/
Thanks for making the good sample. A fix for the menu intersecting the world is using a seperate camera for the GUI layer. The rough animation might be a pixel perfect setting in the sprite rendering (just guessing).
I don't have enough reputation points to write this as a comment.

Resources