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.
Share
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: