How to define limits to camera movement - aframe

I have a panorama image binded to a <a-sky>, i want to limite how much to the left/right and up/down the user can move the camera:
I have disabled WASD movement with <a-camera wasd-controls-enabled="false"></a-camera> but i found no similar controls for camera view movement. Is it possible only with script?

A-Frame does not have this behavior built in. The framework prioritizes VR and AR experiences (where you cannot practically control where someone will look) so you would need to make a custom version of look-controls.js to do what you describe.

Related

How can I support multiple types of VR controllers at the same time in A-Frame?

I'm using A-Frame and I'm trying to figure out how to easily support multiple types of controllers at once (Oculus Touch, HTC Vive controllers, and Windows Mixed Reality controllers), preferably with controller models rendered in the scene and with lasers that would allow the user to click on things.
How do I do this?
I figured out how to do this, so here's my solution.
In your HTML, you can have these to create the controllers (this should be inside an a-scene element):
<a-entity laser-controls="hand: left" raycaster="showLine: true; objects: .clickable;"></a-entity>
<a-entity laser-controls="hand: right" raycaster="showLine: true; objects: .clickable;"></a-entity>
These should also render with the actual controller models in the scene, and each have a laser pointer.
This is what it looks like with the Oculus Touch controllers (ignore the other stuff in the view):
As new types of headsets come out and are supported by A-Frame (e.g. the Valve Index controllers aren't supported yet), the laser-controls component should automatically be updated to support them.
See the docs for a bit more information on how to use controllers in your A-Frame scene.
I still haven't figured out exactly how to make it possible to click on buttons or objects in the environment using the laser, I'll need to figure that out next.

Click events on desktop

Im using aframe for a different purpose than VR. Im using it to show a 3d model where the user can rotate the model, zoom in, out, and inspect various parts of the device on click.
Im using aframe-orbit-controls-component-2 component to make the camera rotate around the device model.
How do I detect mouse clicks on specific parts of the device(I already have these parts with ids, I just need to detect mouse clicks on them) without needing the camera to be focused on said part?
You can use the mouse by setting the cursors attribute rayOrigin: mouse:
<a-scene cursor="rayOrigin: mouse">
....
Check it out here - the console will log the elements which are clicked

Unity canvas overlap using networking

I am using the new unity networking using unity 5.3.1 , my player prefab is a UI canvas , so when another client joins the canvas's overlap and I cannot press any button on host or client .
What i want is to disable other canvase's on each players game and just leave the local players canvase active , I have tried islocalplayer , isclient ,isserver but nothing works .
Is there a way around this please do tell.
Here are some options I can think of:
1) Instead of making canvas a player object, make panel a player object, so that all your players are different panels under same canvas. Now, when object are under same canvas, they ray casting order is determined by the order in hierarchy.
The objects that are lower in the hierarchy occlude those that are higher. So, what you can do is moving your player object to the lowest position in objects hierarchy, so that it will occlude all other players. This can be done using Transform methods SetSiblingIndex and GetSiblingIndex, like
transform.SetSiblingIndex(100000/*some big number*/);
2) Disable raycasting on all other players - what if you can click some component on canvas or not is whether it is a raycast target. Images and Text components can be raycast targets, or more generally any component that inherits from Graphics. You can iterate over all components of type Graphics in all players except the local player and mark raycastTarget = false.
I figured it out and as #NikaKasradze said use only one canvas and put all gui listeners in the islocalplayer bool check .

Cocos3D - Take various screenshots in the background

Using Cocos3D, is it possible to take screenshot of the 3D model in the background without the user knowing it?
For pre-processing purpose and other usage, I want to take screenshots of the 3D model at various angles. Following the Render-To-Texture capability, I noticed when my scene is not visible, the drawSceneContentWithVisitor: method only execute once rather than at every rendering cycle. For obvious reason, the CC3GLFramebuffer* won't get updated with new data, hence, I'm only able to take the initial screenshot.
Thanks.
In Cocos3D, you can render your 3D scene to an off-screen surface. See the CC3DemoMashUp addTelevision and drawSceneContentWithVisitor: methods for an example of how to do this.
What is important is that the 3D drawing environment has been established when you perform your drawing. The safest place to do this is inside your drawSceneContentWithVisitor: method. But if you want to render somewhere else, you need to invoke the CC3Scene open3DWithVisitor: and CC3Scene close3DWithVisitor: methods before and after rendering. See the implementations of the CC3Scene processInitializeScene and open methods for examples of how to do that.
To render your scene from multiple viewpoints, you need to add multiple cameras to your scene, and set the camera property of your drawing visitor appropriately to select a camera before rendering. See how this is done in the CC3DemoMashUpScene addTelevision and drawToTVScreen methods. The drawToTVScreen method also shows how to handle clearing the color and depth buffers of your surface.

Difficulty for user to precisely double-click a data point in Adobe Flex's charts

We have some actions associated with double-click events on a data point inside Flex charts. When user hovers mouse pointer, the mouse datatip is shown properly. However, user needs to double click 'precisely' onto the point, to fire the event correctly. Can we increase 'radius' or 'range' or 'region' or 'target area' of this click event?
PS: Technical details are -
myChart.addEventListener(ChartItemEvent.ITEM_DOUBLE_CLICK, doubleClickHandler);
mychart.dataTipFunction = myDataTipFunction ;
Firefox 3.5
Flex SDK 3.3
Flash Player 10
Please help !!!!
Thanks in advance.
Yes, you can set the mouseSensitivity property on your chart to specify a bounding radius around your data points that flex will use when determining if a point was clicked.
From the docs:
public var mouseSensitivity:Number = 5
Specifies the distance, in pixels, that Flex considers a data point to be under the mouse pointer when the pointer moves around a chart. Flex considers any data point less than mouseSensitivity pixels away to be under the mouse pointer. This value is also used by the findDataPoints method.

Resources