Jump to content
  • Advertisement
Sign in to follow this  
SimonS

OpenGL OpenGL-ES 2.0 problem.

This topic is 3539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I´m having problem with my simple OpenGL-ES program. I think it´s the view or projection matrix, cause the screen is all black. If I dont multiply the coords to hcs it works. Here´s what it looks like: Projection: float f = 1.0 / tan( fov / 2); mProjM[0][0] = f/aspect; mProjM[0][1] = 0.0; mProjM[0][2] = 0.0; mProjM[0][3] = 0.0; mProjM[1][0] = 0.0; mProjM[1][1] = f; mProjM[1][2] = 0.0; mProjM[1][3] = 0.0; mProjM[2][0] = 0.0; mProjM[2][1] = 0.0; mProjM[2][2] = fz/(nz-fz); mProjM[2][3] = -1.0; mProjM[3][0] = 0.0; mProjM[3][1] = 0.0; mProjM[3][2] = (nz*fz)/(nz-fz); mProjM[3][3] = 0.0; View: mLookV = mLookV.normalize(); mUpV = cross(mLookV, mRightV); mUpV = mUpV.normalize(); mRightV = cross(mUpV, mLookV); mRightV = mRightV.normalize(); float x = dot(-mCamPos, mRightV); float y = dot(-mCamPos, mUpV); float z = dot(-mCamPos, -mLookV); mViewM[0][0] = mRightV.x(); mViewM[0][1] = mRightV.y(); mViewM[0][2] = mRightV.z(); mViewM[0][3] = x; mViewM[1][0] = mUpV.x(); mViewM[1][1] = mUpV.y(); mViewM[1][2] = mUpV.z(); mViewM[1][3] = y; mViewM[2][0] = -mLookV.x(); mViewM[2][1] = -mLookV.y(); mViewM[2][2] = -mLookV.z(); mViewM[2][3] = z; mViewM[3][0] = 0.0f; mViewM[3][1] = 0.0f; mViewM[3][2] = 0.0f; mViewM[3][3] = 1.0f; Very glad if someone could help me! I`ve programmed DX9 & 10 before, but new to OpenGL-ES 2.0

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!