I would like to make a multi touch control for my camera
This camera should do:
zoom in/out when pinching
orbit when swiping
pan when swiping with 2 fingers.
Is there somebody who know some good examples/tutorials or give me some advice?
Thank you so much
The best example I found was the Strategy Game (Tower defense) sample that comes with the Unreal Engine. It demonstrates an independent camera system in C++ that responds to touch gestures.
As a simplified but very similar approach you may find also find useful my UE4TopDownCamera sample project for a top down camera with:
spread/pinch or mouse wheel up/down for zoom in/out (implemented as dollying)
swipe with one finger for panning
on/off functionality to lock on/follow main character or freely move
camera.
Please notice that the gestures are not exactly the ones you described, as my requirements were different.
I'll soon upload some full explanation and a video on github.
Related
I am working on a Qt application which resembles hex editor for Mac.
(picture from Google)
It has a very large portion of data to scroll vertically(upward and downward) because it shows all large files data in hex format.
In my application, I'd like to add two finger smooth scrolling in both direction: up and down like that in Macbook Air two finger scrolling.
It work properly with mouse wheel but not with trackpad two finger move scrolling.
If someone has a solution, please help me out. Thanks in advance.
The scroller allows for gestures like click and drag to do kinetic scrolling.
http://qt-project.org/doc/qt-5/qscroller.html#details
Note on this page:
QScroller::TouchGesture 0
The gesture recognizer will only trigger on touch events. Specifically it will react on single touch points when using a touch screen and dual touch points when using a touchpad.
So then the example they give would turn into this for you:
QWidget *w = ...;
QScroller::grabGesture(w, QScroller::TouchGesture);
There is more on doing new things with touch screens and touch pads by handling the QTouchEvent:
http://qt-project.org/doc/qt-5/qtouchevent.html#details
Hope that helps.
I am trying to develop an 2D game using cocos2d library. I am still learning the framework.
Please understand that I am new to game development but not new to programming using objective c.
Here is the issue I am facing when it comes to my game development effort - I feel that I am missing the theoretical understanding of how to develop an infinite scrolling game. Is it possible for any of you to provide me some guidance on that ?
Here is my understanding of achieving infinite scrolling using cocos2d framework:
Cocos2d has a singleton director class which handles the current scene and scene transitions
In the current scene, I feel like I have to create an platform object consisting of several images and add them as a child to the current layer. And constantly run a move action to the platform sprite. So as and when I detect a particular image is off screen I have to replace it with another image. That way I will be able to create an infinite scrolling.
I am sorry if point 2 is not coherent. I just attempted to put my understanding of how to infinite scrolling.
Can you please help me with this ?
Thanks
I dissected how to implement scrolling with cocos2d-iphone in this article. What you probably want is the "fake scrolling" approach where two background images are moved and switch position after one completely left the screen.
You want to do this for the background layer only, not individual sprites. Your world isn't really moving, it's just the background panning that creates the illusion of movement. All sprites etc (player, enemies) movement is still relative to screen coordinates.
You'll find a working implementation in the code for my Learn Cocos2D 2 book in the Shoot'em Up project.
If you don't want to bother implementing this yourself, KoboldTouch supports endless/infinite scrolling for tilemaps. Here the game objects actually move along with the background infinitely (up to the maximum coordinates supported by float which is around +/- 16 million points).
I am trying to create a simple game that mainly consists of a ball rolling down an incline. The player's only control is to cause the ball to jump. My question is, what is the best way to make it appear to roll while generally keeping the ball at the same place on the screen? I have considered CCCamera, but it seems like it's not the best option since I want a repeating background image. Scrolling the background manually is also giving me trouble because it's not clear how to get the ball to stay in one place while letting Box2D handle the physics. I'd appreciate any help as I've been stuck on this for quite a while.
Use CCFollow on the layer where you draw the game stuff, and let it follow the ball sprite:
[gameLayer runAction:[CCFollow actionWithTarget:ball]];
I am working on one-shot learning of gestures. Most of the gestures involve moving the left and the right hand and the hand joints are easily detectable using skeletal tracing library of Kinect SDK. I am facing the problem as to how to guess the start of the gesture and when it ends so that I can feed the coordinates of the hand joint trajectory to my algorithm that finally classifies the gesture?
There is no way you can detect the beginning of a unknown gesture within a learning engine. There must be some discrete action that tells the system that a gesture is about to be started for it to learn. Without this discrete action the system can not know what motion is the beginning of the gesture, v.s. a motion between, v.s. a motion moving towards the beginning, v.s. an arbitrary motion the engine should care nothing about.
There are a few discrete actions that might work, depending on your situation:
a keyboard or mouse action
a known gesture to signify a new gesture is to begin/end
use voice recognition to notify the engine that you are starting/ending
some action with a short countdown timer for the user to get to "position 1" of the gesture and begin when prompted.
have a single origin for all gestures - holding your hand there for a short period to signify beginning of learning action.
Without some form of a discrete action, the system just can not know what you want. It will always guess, and you will always run into a situation where the system guesses wrong.
For executing on a known gesture, your method depends on how you store the data and the complexity of the gesture. Here are two gesture libraries that you can review to see how they work:
http://kinecttoolbox.codeplex.com/
https://github.com/EvilClosetMonkey/Fizbin.Kinect.Gestures
They may also help give ideas of how you want to start/end gestures, based on how the gesture data is stored for each situation.
CameraCaptureUI is a easy way to capture,record video from the camera.
I am Working on Camera App where I use only particular camera say for example, Only Logitech camera be displayed. So when the user press 'change camera" In UI, it will only switch between Logitech camera not others.
I can do it using Media Capture UI.I wanted to know whether it is possible through CameraCapture UI Api or not Since this will reduce the development time.
I am using C++ as programming language.
It does not seem to be an option on the CameraCaptureUI - it really is pretty simplified. If you are going with the MediaCapture/CaptureElement route - you might want to check the CameraCaptureControl in the WinRT XAML Toolkit. It is C# code, but it has some things figured out for controlling the cameras.