I cant rotate the camera with the RMB, no panning with middle mouse button and the arrows on an object don't move the object, only the inner circle
thanks in advance
ned
Related
I have a usdz model with walking animation in the scene. I will have a tapGesture added to ARView, through which i can get the tapped 2D point, and rayCast it to get the rayCastResult from the 3D scene, now I want to first rotate model in the tapped direction, then move it the destination by playing walking animation on it, the model should face tapped direction only everytime, even after walking is completed it should not change the direction.
I'm trying to zoom by changing Orthographic Camera's value.
Though when I change it's value, changes rather occur in Scene View not in the Game View.
Canvas shown in Scene View gets bigger but there's no change in Game View.
Whether I try to zoom by code or manually in the inspector same thing happens.
Here's Image of some screenshots.
Camera inspector
Orthographic size set to 5
Orthographic size set to 8
Canvas inspector
Would appreciate some help.
Camera.orthographicSize
I want to move the sprite to the release position of the mouse left button. The problem is OnRelease event is fired when the mouse button is release while the mouse is over the sprite. i want to somehow fire an event when the mouse left button released anywhere in the scene after i actually clicked on the sprite.
You shold try to record that you have actually clicked on the sprite. For example, a boolean variable in your player controller.
I am trying to create a menu for my app with a few icons in a circle. User should be able to spin this menu, making the icons change their positions around this circle path, but not rotating themselves. I read this earlier http://www.raywenderlich.com/9864/how-to-create-a-rotating-wheel-control-with-uikit so I can see how to follow the finger movement, but I need this menu to have inertial spin after the touch ends. I have 2 questions about how to do this.
First one, what's the best way to make animation with icons moving around in a circle? It should be slowing down until it stops and, if user moves his finger fast enough, should be able to do more than one full circle.
Second, how do I measure speed of finger movement at the end of it? I tried to use locationInView and previousLocationInView and just spin it by difference of angles between them multiplied by some constant. Problem is, when I keep my finger in one place for a while and take it up, I still get inertial movement of the circle and in this case I don't want it to move at all.
You want to use a scroll view. Specifically you want a hidden scroll view where you attach the pan gesture recogniser from the scroll view to your custom menu view. Then you implement the delegate methods of the scroll view to redraw your menu. This WWDC video has a good overview of the process. The benefit of this approach is that you get true iOS style acceleration and deceleration for free. You don't need to worry about finger position or speed, only the content offset of the scroll view.
Unless you want to spin your finger round in a circle with the menu items. That's a different ball game...
In theory, the same approach as above can be used for spinning your finger in a circle. You would need to ensure that directionalLockEnabled was set to NO on the scroll view. The problem is that the calculations to determine the rotation of your menu view are a lot more complex. Probably you would want to be modal and check if the scroll view is dragging in the callbacks. If it is dragging you would use the touches on the pan gesture to find the exact finger location to set the rotation. You'd also want to maintain data on the instantaneous direction of finger movement so that when the touch is released... If it isn't dragging then you use the scroll view content offset to apply the deceleration effect on the rotation (using the scroll direction just before the touch was released to know how to use the content offset changes).
I want to rotate an UIView using CGAffineTransform and I'm able to rotate View using CGAffineTransform.
But I want to rotate UIView smoothly on finger touch based on swipe gestures.
So like right swipe, left swipe I was able to detect swipe but when I swipe from down to right or from down to left, I'm not able to detect swipe gesture of these types...
Sanjay these are the only allowable gestures that a iPhone supports
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/instp/UISwipeGestureRecognizer/direction
so I think you are trying to recognize a diagonal swipe gesture and the its not working.
and also there is a minimum numberOfTouchesRequired required for swipe gesture.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UISwipeGestureRecognizer_Class/Reference/Reference.html#//apple_ref/occ/cl/UISwipeGestureRecognizer
And if you want to rotate a UIView object than I think you will find the code in this link
rotating a view on touch
Hope this helps.