OPENGL/ES 3D模型缩放后无法在UIScrollView中正确平移 [英] OPENGL/ES 3D model zoomed doesn't pan correctly in UIScrollView

查看:54
本文介绍了OPENGL/ES 3D模型缩放后无法在UIScrollView中正确平移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UIView中渲染了3D模型.当我捏模型时,它会正确缩放,但是当我放大模型时,我希望能够平移/滚动视图,以便可以看到模型在视图边界之外的部分.我将UIView切换为UIScrollView,并在发生捏事件时使用比例因子更新内容大小.这很好用,我现在可以滚动视图.我的问题是,平移到内容视图的外边缘仍会显示3d模型仍被裁剪为初始视图的大小.我希望这是有道理的...

I have a 3d model rendered in a UIView. When I pinch the model it zooms correctly, but when zoomed in I'd like the ability to pan/scroll the view so that I can see the parts of the model which are outside the boundaries of the view. I switched the UIView to a UIScrollView, and on the pinch event is update the content size with the scale factor. This works great and I can now scroll the view. My problem is that panning to the outer edges of the content view still shows the 3d model still clipped at the size of the initial view. I hope this makes sense...

是否有人知道渲染椅子的放大部分(现在应该可以看到(平移后))需要什么?

Does anyone have an idea what might be needed to render the zoomed in parts of the chair, which should now be visible (after panning)?

推荐答案

设置UIView.bounds以及UIScrollView内容大小后,我可以使它正常工作.也就是说,scrollview包含uiview,该uiview包含3d模型.我正在调整滚动视图的大小,而不是uiview的大小.都需要对其进行设置才能使其正常工作.

I was able to get this working after setting the UIView.bounds as well as the UIScrollView content size. That is, the scrollview contained a uiview, which contained the 3d model. I was resizing the scrollview, but not the uiview. They both needed to be set in order for this to work.

这篇关于OPENGL/ES 3D模型缩放后无法在UIScrollView中正确平移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆