خرید بک لینک

Vote count: 0

I'm working in iOS and using GLKit to try to perform some simple matrix manipulations. In a nutshell: I'm looking to rotate a number of objects around the centre of the viewport by a certain number of degrees (the objects are not positioned at the centre of the viewport, I'm simply looking for the rotation to pivot around the centre).

From reading, it appears I can achieve this by:

  1. Translating the object so that it lies at the world coordinate origin
  2. Performing the rotation
  3. Translating the object back to it's original position

I have a number of questions though:

  1. First and foremost: is this the correct approach?
  2. Is the world coordinate origin always 0, 0, 0, or is it affected by the values used to create my orthographic projection?
  3. To calculate gl_Position in my vertex shader I'm essentially doing the following: projectionMatrix * modelViewMatrix * position. Am I correct in assuming it's best to manipulate the modelViewMatrix for this kind of operation, or would it be best to rotate the projectionMatrix to handle all objects simultaneously?
asked 59 secs ago

- - , .

برچسب: نویسنده: استخدام کار تاريخ: شنبه 1 اسفند 1394 ساعت: 21:43

صفحه بندی