iPhone 上 glGetClipPlanef() 的正确用法
我有一个自定义剪切平面,可以更改我正在编写的应用程序中的方向。我希望能够在某些时间得到该剪裁平面的方程。函数 glGetClipPlanef() 似乎是我想要的,但由于某种原因,每当我调用它时,它都会抛出 EXC_BAD_ACCESS 错误。关于如何调试此错误或正确使用此函数有什么想法吗?我有用于为每个帧创建剪切平面的平面方程,但在实际应用剪切之前,对场景应用了多次变换,这导致剪切平面的方程发生巨大变化。
I have a custom clipping plane that changes orientation in an app I'm writing. I'd like to be able to get the equation to that clipping plane at certain times. The function glGetClipPlanef() seems to be what I want, but for some reason it keeps throwing an EXC_BAD_ACCESS error whenever I call it. Any ideas on how to debug this error or on correct usage of this function? I have the plane equation that is used to create the clipping plane for each frame, but several transformations are applied to the scene before the clipping is actually applied, which causes the equation of the clip plane to change drastically.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想通了。对于任何想知道的人,
都会导致 EXC_BAD_ACCESS 错误,因为 ClipVals 尚未为四个浮点分配内存。我必须为 ClipVals 分配一些内存或像这样声明它:
I figured it out. For anyone that was wondering,
will cause an EXC_BAD_ACCESS error because clipVals has not had memory allocated for four floats. I had to either allocate some memory for clipVals or declare it like so: