About Monkey 2 › Forums › Monkey 2 Programming Help › mojo3D – util.Fly() for mobile?
This topic contains 8 replies, has 3 voices, and was last updated by
cocon 1 year, 6 months ago.
-
AuthorPosts
-
September 25, 2017 at 4:55 pm #10804
Anyone got one?
September 25, 2017 at 8:21 pm #10805I think you can touch left for rot left, right for rot right, center for move foward.
September 26, 2017 at 8:49 am #10818ok, but I’m lloking for a complete dropin that does pan, tilt(rotation), zoom and rotation.
Based on the way they do it in Google maps ( https://www.youtube.com/watch?v=aKulxv-26mo ) it could be:
1 finger = pan
2 fingers:
pinch = zoom
angles between fingers delta = Z rotate by this amount
2 finger pan : XY rotate model
September 26, 2017 at 9:11 am #10819Can monkey support gestures? I have not tried mobile yet.
September 27, 2017 at 10:44 pm #10851ok, but I’m lloking for a complete dropin that does pan, tilt(rotation), zoom and rotation.
Util fly was a 5 minute hack designed to do 3 things: rotate left/right and move forward! So no, it doesn’t do gesture recognition etc.
I got 2d scale/drag/rotate going quite nicely I think – see touchtest banana – but I haven’t attempted 3d as yet. In fact, I don’t think I’ve even seen any examples – can you describe a bit more clearly what you’re after?
September 28, 2017 at 8:58 am #10855I tried out touchtest banana, and it comes very close to what i’m looking for.
if 1 finger could then rotate the model, we’d have a cool quick way of looking at 3D scenes.
To make it more versatile, it would be nice if the same Fly() would work on desktop.
PS: Mojo3D is really nice
September 28, 2017 at 7:17 pm #10861pinch/zoom doesn’t quite work in 3d though does it? You want pinch/move which is a bit different, or do you keep pinching over and over to move?
And how would rotate work? Swipe left/right? Or hold and drag to look? Would be good to learn how swipe works anyway…
It was be nice to see an example! Any recommendations for android/ios?
September 29, 2017 at 7:16 am #10879Yes, I guees Fly() is the wrong name for this, just pinch a bunch of times to zoom, this is not for a FP shooter, only for viewing a model.
I like the Sharpr3D method, because it leaves the 1 finger free to do other stuff, however two fingers is not ideal on a small phone screen.
Get it from https://itunes.apple.com/hu/app/shapr3d/id1091675654?mt=8&_branch_match_id=442203562782760740
Modeling is only for iPad Pro, but there is a “view only” mode for normal ipads that does what I describe below.
This is what I’m looking for: https://www.youtube.com/watch?v=UsupbPZPOfU
Here is a guy dooing the rotation in unity: https://www.youtube.com/watch?v=S3pjBQObC90
I don’t think the actual swipe gesture is needed for this, just 1 finger move.
How about this:
Pinch = move the camera in /out (zoom), whilst LookAt() the model (or 0,0,0)
(Sharpr3D also pans the LookAt() center, when you move two fingers)
1 finger move/left mouse button + move = Camera moves in a circle (sphere), while looking at the model (or 0,0,0)
Shortest screen dimension swipe/move finger equals 180 degrees rotation on that axis.
Example in portrait mode: Touch center of screen, move finger to right edge of phone = rotate camera CCW 90 degrees around Y (assuming Y is up)
Not that important but:
Two fingers rotate = Rotate the camera around the camera.Pos – LookAt() axis, hopefully camera z axis ?
October 2, 2017 at 4:15 pm #10937This brings me an idea of capturing this turning this touchtest into a nice component.
This is a rough sketch I made of the design to get an idea of where is going, when I will actually start doing mobile I will return to this thread and post an update. For more information I will also examine other engines just to clear things out and avoid any confusion on the API.
Monkey1234567891011121314151617181920212223242526272829Class GestureInputMethod Update()' does every sort of update here' such as how many active touches' and what state are they are inEndProperty IsFingerUp:Bool ' any finger up assuming 1Method IsFingerUp:Bool(amount:Int) ' how many fingers (1 or many)Property IsFingerDown:Bool ' any finger down assuming 1Method IsFingerDown:Bool(amount:Int) ' how many fingers (1 or many)Field TouchState:Bool[5] ' keeping touch state of all touchesField PrevTouchTime:Double[5] ' keeping the timing of all touchesProperty OnFingerUp:Void() ' a callback for when finger is upProperty OnFingerDown:Void() ' a callback for when finger is downProperty IsGesturePinch:Bool() ' pinchingProperty IsGestureDoubleTap:Bool() ' double tappingFunction IsGestureDoubleTapWith(fingers:Int) ' double tapping with how many fingersField TouchDragSpeed:Vec2f ' how fast is the touch dragProperty IsSwipe:Bool() ' if swipe happensProperty SwipeSpeed:Vec2f ' how fast was the swipeProperty SwipeDirection:String ' converting swipe to angle and return id (U/D/L/R)End -
AuthorPosts
You must be logged in to reply to this topic.