Search Results

Search found 2 results on 1 pages for 'timemanx'.

Page 1/1 | 1 

  • 3d cube using canvas. Need a little improvement

    - by TimeManx
    I made this 3d cube using the following code Matrix mMatrix = canvas.getMatrix(); canvas.save(); camera.save(); camera.rotateY(-angle); camera.getMatrix(mMatrix); mMatrix.preTranslate(-width, 0); mMatrix.postTranslate(width, 0); canvas.concat(mMatrix); canvas.drawBitmap(bmp1, 0, 0, null); camera.restore(); canvas.restore(); camera.rotateY(90 - angle); camera.getMatrix(mMatrix); mMatrix.preTranslate(-width, 0); mMatrix.postTranslate(width2, 0); canvas.concat(mMatrix); canvas.drawBitmap(bmp2, width, 0, null); This is what it gives But what I need is It's because when Camera rotates the images, some part of the image gets hidden. Like this But I think this can be done.

    Read the article

  • OpenGL ES perspective projection

    - by TimeManx
    I'm having a hard time understanding how glFrustum & gluPerspective work. I understand the concept of perspective projection but the functions aren't behaving how I expect them to. For example, if I set the frustum this way glFrustumf(0, 10, 0, 10, 1, 100) and have a rectangle at points 0, 0, 1, 0, 10, 1, 10, 10, 1, 10, 0, 1 then the rectangle is drawn with its left edge at -5 & right edge at 5, so the left half of the rectangle isn't visible. And if x is translated, I'd expect y to be too. But that doesn't happen either. In whatever examples I've seen, the coordinates for the projection matrix are taken as glFrustumf(-10, 10, -10, 10, 1, 100) but either way, whatever part is shown should be dependent on the rectangle's coordinates, right?

    Read the article

1