I want to fix the roll without missing the default 3d control - autodesk-forge

I am using Forge viewer on mobile device.
Default Forge viewer is rolling on mobile device when moving to a position using pinch gesture.I research how to fix the roll (reference to Fixing pinch-zoom in Forge viewer applications - Through the Interface, GitHub - wallabyway/forge-pinch-zoom: customized iPad/IPhone/Android pinch zoom touch controls for ForgeViewer), but it is missing default 3D control. For example, it's missing pan motion when I use two-finger gesture. I want to fix the roll without missing the default 3d control. How do I do it?
I have tried to disable to rotate gesture in GestureHandler. (gestureHandler.setGestureParameter(); )
I have checked to invalidate pinch gesture correctly; gestureHandler.setGestureParameter('pinch', 'enable', false)
But I have checked that it is still valid to roll, regardless if the enable is false; gestureHandler.setGestureParameter('rotate', 'enable', false).
let orbit = viewer.impl.controls.getActiveTool()
let gestureHandler = orbit.controller.getActiveTools()[2]
gestureHandler.setGestureParameter('rotate', 'enable', false)
I have another question.
It emits the pinch event after I pinch gesture. I understand this behavior.
It is not emitting the roll event after I do the roll gesture while doing the pinching gesture. I can't understand this behavior.
Maybe there are the multiple methods controlling the camera roll. I can't figure out the method to control the roll on mobile device anywhere.

Related

Adobe Air - Starling/Features | Controls and device simulator

I have few questions here, regarding creating app in Adobe Air using Starling and feathers.
I created yet a very simple app, which has Feathers list controller with static data provided to its dataProvider. According to the code it should work fine, but there are three major issues I am facing.
1: Touch/Click Positions
I am using:
list.addEventListener( Event.CHANGE, list_changeHandler );
Now the problem is, clicking coordinates are not correct. Clicking on 3rd Item triggered 4th item, to trigger 3rd, 2nd item needs to be clicked it's half way through etc.
2: Nothing, without Theme
I am using a custom theme, came along with a tutorial. If I don't use the theme, I am unable to see anything on the screen, somehow.
3: Resolution (Device Simulator) Problem
Though buggy, but it works with Theme, but my app doesn't fit with the resolution for each device simulator. Either its, iPad or iPhone 4 or any android simulator.
Also, can anyone please also explains, what is significance and use of Context3D render mode in starling class.
Any help is appreciated:
Thanks in advance
Waqar Iqbal
Starling is a Stage3D framework that displays content directly on graphic card using Context3D. Everything displayed by Starling is always under the regular display list. Feather is a component framework based on Starling.
Stage3D cannot handle any mouse operations so Starling and Feather simulate all their mouse event (those mouse event never really happen anywhere, they are created by calculation of mouse position on the stage)
not sure, never used Feather
Starling does not handle screen density and dpi calculation, if you want your app to fit any screen you'll have to handle it yourself.
I think you should see the example carefully. if u want to use any feathers component either you have to use feathers theme or custom theme.
if you use feather theme you need to provide theme path and before using any component you need to initialize that theme.Then use component any where.without theme you will not see any thing.
1: Touch/Click Positions
please provide minTouchHeight in class theme of DefaultListItemRenderer like:-
renderer.minWidth = this.gridSize;
renderer.minHeight = this.gridSize;
renderer.minTouchWidth = this.gridSize;
renderer.minTouchHeight = this.gridSize;
2: Nothing, without Theme,
3: Resolution (Device Simulator) Problem
Follow the example given in feather library
feathers-2.1.1\themes\MetalWorksMobileTheme\source\feathers\themes

Flash AS3 Pinch Gesture Support

I'm working on a Flash as3 project and need to detect a pinch (move two fingers toward each other )
does this gesture supported in as3 ?
how can i make something similar to it ?
it isn't supported in ِAS 3 but you can use drag and drop with animation of your object
ob.stop(); // at beginning
ob.play(); // when start drag

How can I detect the number of fingers used in a swipe gesture?

My intention is to have different gesture-based actions occur depending on whether the user swipes the screen with one or two fingers. I'm a little new to touch app development and I'm not seeing the necessary information in either Manipulation events or the Toolkit GestureService. I'm fine with using more low-level touch logic or manually tracking the number of touch contacts if necessary, I just need a little guidance on how to differentiate single from double-touch in a gesture.
This may help you to resolve your problem. There is property to find the second touch point in the gesture panel.
GestureSample sample = TouchPanel.ReadGesture();
Vector2 first = sample.Position;
Vector2 second = sample.Position2;
Position2 property will return the seocond touch position in the Gesture panel.

AS3 Multitouch Event Behavior

If I set Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT; will there still be dispatched a MouseEvent.CLICK when the users tabs? or will there ONLY be dispatched a TouchEvent.TOUCH_TAP event ?
(on a multitouch supported device)
Actually, mouse events are dispatched in this case for the first point of contact. That's how UI elements not suited for touch input continue to work on touch devices.
At least MOUSE_DOWN and MOUSE_UP are dispatched right after TOUCH_BEGIN and TOUCH_END which is very annoying sometimes.
Finally found the answer to this, sorry Stackoverflow, wasn't trying to spam!
MultitouchInputMode.TOUCH_POINT: Use this mode if you are interested only in touch events and no mouse or gesture events. You can use this mode to synthesize your own gestures if you want to support gestures that are not supported by the runtime, or if you need to support both multitouch and gestures. (http://www.adobe.com/devnet/flash/articles/multitouch_gestures.html)
In case anyone else finds the native touch implementation falls short there is also the following which may be worth looking into:
Gestouch: NUI gestures detection framework for mouse, touch and multitouch AS3 development.
Gestouch is a ActionScript library/framework that helps you to deal with single- and multitouch gestures for building better NUI (Natural User Interface).
https://github.com/fljot/Gestouch

Are there any libraries providing mouse-driven zoom/pan for pure AS3 projects?

Today I wanted to add mouse-driven zoom and pan functionality to a pure AS3 project - something like the Google Maps interface. I was surprised that I couldn't find a good package or library to do this already - I'm using FlashDevelop rather than Flash CS3, so the nice VCam tool available as an FLA is no use.
There's nothing very complicated involved in implementing zoom/pan, although it can be fiddly and time-consuming to get right, but since zooming and panning are pretty common things to want to do I wondered if anyone could suggest a 'correct' way to do this in the Flash world, or a good library available that I haven't been able to find.
I found exactly what I was looking for in the flare library's PanZoomControl:
Interactive control for panning and
zooming a "camera". Any sprite can be
treated as a camera onto its drawing
content and display list children. To pan and zoom
over a collection of objects, simply
add a PanZoomControl for the sprite
holding the collection.
var s:Sprite; // a sprite holding a collection of items
new PanZoomControl().attach(s); // attach pan and zoom controls to the sprite
The mouse controls are also implemented as you'd expect:
Once a PanZoomControl has been
created, panning is performed by
clicking and dragging. Zooming is
performed either by scrolling the
mouse wheel or by clicking and
dragging vertically while the control
key is pressed.
You could use a 3D library such as Papervision3D or FIVe3D. Then just move your camera based on different mouse events/gestures. Or use the built in z-axis in FlashPlayer 10 to get the zoom effect.