¡@

Home 

2014/10/15 ¤U¤È 10:09:39

iphone Programming Glossary: glfloat

iPhone OpenGL ES - How to Pick

http://stackoverflow.com/questions/2540447/iphone-opengl-es-how-to-pick

I do it IMPoint2D and IMPoint3D are basic x y and x y z structures IMPoint2D getScreenCoorOfPoint IMPoint3D _point3D GLfloat p 16 Where The 16 Doubles Of The Projection Matrix Are To Be Stored glGetFloatv GL_PROJECTION_MATRIX p Retrieve The.. Projection Matrix Are To Be Stored glGetFloatv GL_PROJECTION_MATRIX p Retrieve The Projection Matrix Multiply M point GLfloat _p p 0 _point3D.x p 4 _point3D.y p 8 _point3D.z p 12 p 1 _point3D.x p 5 _point3D.y p 9 _point3D.z p 13 p 2 _point3D.x..

Apple gyroscope sample code

http://stackoverflow.com/questions/3245733/apple-gyroscope-sample-code

and then store it in an OpenGL compatible matrix. The code below retrieves and saves the current device motion. GLfloat rotMatrix 16 void getDeviceGLRotationMatrix CMDeviceMotion deviceMotion motionManager.deviceMotion CMAttitude attitude..

Can example “GLImageProcessing” work with multi filters

http://stackoverflow.com/questions/4375479/can-example-glimageprocessing-work-with-multi-filters

2 GL_FLOAT sizeof V2fT2f flipquad 0 .s glTexEnvi GL_TEXTURE_ENV GL_TEXTURE_ENV_MODE GL_COMBINE static GLfloat constColor 4 0.1 0.2 0.3 0.4 if t 1.0f glTexEnvi GL_TEXTURE_ENV GL_COMBINE_RGB GL_ADD glColor4f t 1 t 1 t 1 t 1 constColor.. GL_COMBINE_ALPHA GL_REPLACE glTexEnvi GL_TEXTURE_ENV GL_SRC0_ALPHA GL_TEXTURE process 2 adjust contrast t 1.6 GLfloat h t 0.5f One pass using two units contrast 1.0 interpolates towards grey contrast 1.0 extrapolates away from grey Here the..

Getting displacement from accelerometer data with Core Motion

http://stackoverflow.com/questions/4449565/getting-displacement-from-accelerometer-data-with-core-motion

nil attitude multiplyByInverseOfAttitude referenceAttitude CMRotationMatrix mat attitude.rotationMatrix GLfloat rotMat mat.m11 mat.m21 mat.m31 0 mat.m12 mat.m22 mat.m32 0 mat.m13 mat.m23 mat.m33 0 0 0 0 1 glMultMatrixf rotMat This works..

How can I optimize the rendering of a large model in OpenGL ES 1.1?

http://stackoverflow.com/questions/5718846/how-can-i-optimize-the-rendering-of-a-large-model-in-opengl-es-1-1

as well. Try using a smaller data type for your vertex information. I found that I could use GLshort instead of GLfloat for my vertices and normals without losing much precision in the rendering. This will significantly compact your geometry..

Undo drawing in Paint Application

http://stackoverflow.com/questions/6689600/undo-drawing-in-paint-application

Erase NO glColor4f app.rg app.bg app.gg kBrushOpacity void drawErase CGPoint start toPoint CGPoint end static GLfloat eraseBuffer NULL static NSUInteger eraseMax 64 NSUInteger vertexCount 0 count i EAGLContext setCurrentContext context glBindFramebufferOES.. scale end.x scale end.y scale Allocate vertex array buffer if eraseBuffer NULL eraseBuffer malloc eraseMax 2 sizeof GLfloat Add points to the buffer so there are drawing points every X pixels count MAX ceilf sqrtf end.x start.x end.x start.x end.y.. 1 for i 0 i count i if vertexCount eraseMax eraseMax 2 eraseMax eraseBuffer realloc eraseBuffer eraseMax 2 sizeof GLfloat eraseBuffer 2 vertexCount 0 start.x end.x start.x GLfloat i GLfloat count eraseBuffer 2 vertexCount 1 start.y end.y start.y..

Record the drawing as a m4v video file - OpenGL

http://stackoverflow.com/questions/9661259/record-the-drawing-as-a-m4v-video-file-opengl

a line onscreen based on where the user touches void renderLineFromPoint CGPoint start toPoint CGPoint end static GLfloat vertexBuffer NULL static NSUInteger vertexMax 64 NSUInteger vertexCount 0 count i EAGLContext setCurrentContext context.. scale end.x scale end.y scale Allocate vertex array buffer if vertexBuffer NULL vertexBuffer malloc vertexMax 2 sizeof GLfloat Add points to the buffer so there are drawing points every X pixels count MAX ceilf sqrtf end.x start.x end.x start.x end.y.. for i 0 i count i if vertexCount vertexMax vertexMax 2 vertexMax vertexBuffer realloc vertexBuffer vertexMax 2 sizeof GLfloat vertexBuffer 2 vertexCount 0 start.x end.x start.x GLfloat i GLfloat count vertexBuffer 2 vertexCount 1 start.y end.y start.y..