I'm trying to render a sky using D3D 11. What I have seen in tutorials so far uses cube mapping, which I don't want to use. I want to create a sphere, texture it, and center that sphere on the camera, but I don't know how to do the last part.

How do I center it around the camera?

  • \$\begingroup\$ Simply drop the translation-component in your mvp-matrix. \$\endgroup\$ – tkausl May 13 '16 at 19:28
  • \$\begingroup\$ what do you mean by drop it, should I set to 0,0,0,? \$\endgroup\$ – ahmed andre May 13 '16 at 19:42
  • \$\begingroup\$ Yes. Usually you just use the rotation of your camera and drop translation (and scaling if you happen to have scaling in your ViewProjection matrix). \$\endgroup\$ – tkausl May 13 '16 at 20:02

Set the sphere's world space position equal to the camera's world space position. Or set the sphere's view space position to the zero vector.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.