Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Scarboy
Jan 31, 2001

Good Luck!
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.

Adbot
ADBOT LOVES YOU

Scarboy
Jan 31, 2001

Good Luck!
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?

Scarboy
Jan 31, 2001

Good Luck!

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 :(

Scarboy
Jan 31, 2001

Good Luck!
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?

Scarboy
Jan 31, 2001

Good Luck!
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.

Adbot
ADBOT LOVES YOU

Scarboy
Jan 31, 2001

Good Luck!
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.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply