Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualsufimaster

Posted 24 February 2013 - 12:16 AM

Ok, so I have a sprite with x,y,z (10,10,0)  with w/h 10fx10f

 

I have left as 0 and right as 680

top as as 480, bottom as 0

 

Still I see nothing.

 

Also, I am using lwjgl, in which if you have a matrix4f, I think m23 means 2nd column, 3rd row. 

 

 

 

  

 

              Sprite sprite = new Sprite("assets/texture/redman.png", 50f, 50f, 10f, 10f );
 
projectionMatrix.m00 = 2/WIDTH;
        projectionMatrix.m11 = 2/HEIGHT;
        projectionMatrix.m22 = -2/(far_plane - near_plane);
        projectionMatrix.m30 = -1;
        projectionMatrix.m31 = -1;
        projectionMatrix.m32 = -((far_plane + near_plane)/(far_plane - near_plane));
        projectionMatrix.m33 = 1;

         cameraPos = new Vector3f(0,0,-1); ...

 

 

//Translate camera        
Matrix4f.translate(cameraPos, viewMatrix, viewMatrix);

        //Scale, translate and rotate model
        Matrix4f.scale(modelScale, modelMatrix, modelMatrix);
        Matrix4f.translate(modelPos, modelMatrix, modelMatrix);
        Matrix4f.rotate((float)Math.toRadians(modelAngle.z), new Vector3f(0,0,1), modelMatrix, modelMatrix);
        Matrix4f.rotate((float)Math.toRadians(modelAngle.y), new Vector3f(0,1,0), modelMatrix, modelMatrix);
        Matrix4f.rotate((float)Math.toRadians(modelAngle.x), new Vector3f(1,0,0), modelMatrix, modelMatrix);
 

 

 

..


#1sufimaster

Posted 23 February 2013 - 02:14 PM

Ok, so I have a sprite with x,y,z (10,10,0)  with w/h 10fx10f

 

I have left as 0 and right as 680

top as as 480, bottom as 0

 

Still I see nothing.

 

Also, I am using lwjgl, in which if you have a matrix4f, I think m23 means 2nd column, 3rd row. 


PARTNERS