You are close, the logic is not working a bit.
The initial case is good, you need to “remember” the scale at which the pinch was started, and this is probably the scale that was set the last time you zoomed in.
There are two problems in your changed case.
- ,
startScale = Double(100/zoom), , (, ). GR, "" . - reset
startScale . ""; .
, , . , startScale = startScale * zoom .
, , , . , zoom, , , . FOV 30-60 , 0,1 - 10 ( ).
func handlePinch(gestureRecognize: UIPinchGestureRecognizer) {
if gestureRecognize.numberOfTouches() == 2 {
let zoom = gestureRecognize.scale
if (gestureRecognize.state == UIGestureRecognizerState.Began){
startScale = lastScale
} else if (gestureRecognize.state == UIGestureRecognizerState.Changed){
let fov = Double(100/(startScale * zoom))
bimScene.zoom(fov)
} else {
lastScale = startScale * zoom
}
}
}