Jump to content
  • Advertisement
Sign in to follow this  
SimonS

OpenGL OpenGL-ES 2.0 problem.

This topic is 3616 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!