|
I'm rendering a bunch of different line segments in a straight line on the iPhone using glDrawArrays and GL_LINES on a 2d projection. They look fine, but when I scale the screen using glScalef some of the lines (on the same y axis or x axis, depends on the scale level) seem to move up or down one pixel. It seems completely dependent on the scale level (they ones moving change as I zoom in and out). I've tried enabling smooth lines, however, the version of OpenGL ES on the iPhone simply ignores it. The next thing I tried to do was draw my lines using gl_triangle_strips. This was slow as hell and at certain scale levels some groups wouldn't draw at all. So here are my questions. Why do the lines shift up or down slightly as I scale? Should I be scaling the screen (to zoom) using glScalef? This is my first time using opengl so please be kind.
|
# ¿ Oct 19, 2008 21:34 |
|
|
# ¿ Apr 29, 2024 20:04 |
|
This should be really simple but I can't figure it out. I'm drawing a big black quad over the entire iphone screen. I want to load a texture of a circle onto the screen to REMOVE the black from that area (e.g. see what's behind the big black quad in that area). Any simple way to get this working with blend functions or something obvious that I can't figure out?
|
# ¿ Nov 22, 2008 23:36 |
|
shodanjr_gr posted:You can do this in a few ways (not with blending though). THe first that comes to mind is to use the stencil buffer to find the affected fragments by the "circle draw" and only draw on those pixels for the final pic. I've read solutions that use the stencil buffer but OpenGL ES on the iphone doesn't support it
|
# ¿ Nov 23, 2008 04:47 |
|
I have a camera in OpenGL using the gluLookAt function that is working correctly. The camera rotates around a fixed point at the center of the screen. Is there any way i can lower the center point of the camera on the screen/viewport/window? I don't want to put the center of the camera a few units further on the z-axis because then my object moves when the camera rotates around it. I want the object to always be in the same place, have the camera rotating around it, and to not be at the center of the screen (somewhere in the lower 1/3 of the screen). Any way to do this?
|
# ¿ Feb 24, 2009 16:09 |
|
I know the math behind what gluLookAt does, that's why I couldn't wrap my head around how to do it. Thankfully, the second you said off center projection I just smacked myself on the head and said, "oooooooooh, that's why my graphics professor said glFrustum is useful for off center projections" oh so long ago. I've got it working exactly how I want it now, thanks.
|
# ¿ Feb 25, 2009 06:31 |
|
|
# ¿ Apr 29, 2024 20:04 |
|
In my experience, if you do ReadPixels after you've rendered everything in a frame it will be much much much faster. I haven't found any alternative to using it on the iPhone so this makes me happy for now.
|
# ¿ Sep 3, 2009 17:31 |