Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5848493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:52:00+00:00 2026-05-22T12:52:00+00:00

my situation is that i receive different images from the server onto the iPhone

  • 0

my situation is that i receive different images from the server onto the iPhone client.

what i need to do is to add a Fisheye effect to those images.

what my hallucination is that i can build a dome object, then attach images to it as they come to me.

if anyone can give me any pointers to the right direction i’ll be thankful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:52:01+00:00Added an answer on May 22, 2026 at 12:52 pm

    Have you tried looking at Paul Bourke’s example code for OpenGL? I don’t know if it’s compatible with OpenGL-ES. Note the feedback about using “glCopyTexSubImage2D instead of doing a slow glReadPixels”.

    AFAICT, Paul Bourke is doing essentially what you said, creating a distorted grid (your “dome object”) to lay the image on.
    According to this question, that’s a good approach.

    Updated:

    Or, since iPhone’s OpenGL-ES supports shaders (at least in some versions), you could get better performance using a plane distortion technique like this. You’d just have to change the formulas for uv.x and uv.y. Then you wouldn’t need to be concerned about breaking up the image into a grid of small polygons… you’d have single-pixel resolution for free. 🙂

    Hm… maybe you need to define what kind of “fisheye” effect you are looking for. Seems there is more than one.

    See also this question.

    Updated again:

    Here is some GLSL code I wrote to do a lens effect in a shader. I believe it’s a hemispherical fisheye lens. It runs under WebGL, which uses OpenGL ES, so it should be adaptable for iPhone.

    #ifdef GL_ES
    precision highp float;
    #endif
    
    uniform vec2 resolution;
    uniform vec4 mouse;
    uniform sampler2D tex0;
    
    // lens
    void main(void)
    {
        vec2 p = gl_FragCoord.xy / resolution.xy;
        vec2 m = mouse.xy / resolution.xy;
        float lensSize = 0.4;
    
        vec2 d = p - m;
        float r = sqrt(dot(d, d)); // distance of pixel from mouse
    
        vec2 uv;
        if (r >= lensSize) {
            uv = p;
        } else {
            // Thanks to Paul Bourke for these formulas; see
            // http://paulbourke.net/miscellaneous/lenscorrection/
            // and .../lenscorrection/lens.c
            // Choose one formula to uncomment:
            // SQUAREXY:
            // uv = m + vec2(d.x * abs(d.x), d.y * abs(d.y));
            // SQUARER:
            uv = m + d * r; // a.k.a. m + normalize(d) * r * r
            // SINER:
            // uv = m + normalize(d) * sin(r * 3.14159 * 0.5);
            // ASINR:
            // uv = m + normalize(d) * asin(r) / (3.14159 * 0.5);
        }
    
        vec3 col = texture2D(tex0, vec2(uv.x, -uv.y)).xyz;
    
        gl_FragColor = vec4(col, 1.0);
    }
    

    To test this, paste it into ShaderToy in a WebGL-enabled browser. Set input 0 to a texture like http://www.iquilezles.org/apps/shadertoy/presets/tex0.jpg or http://www.iquilezles.org/apps/shadertoy/presets/tex4.jpg

    Click the play button, and drag the mouse around on the rendering area. The lens is centered on the mouse pointer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm in this situation that i need a list of lists. for instance i
I am in kind of situation that I need to start with a tab
I'm developing an application that will need to communicate with itself running on different
Consider the following situation: students receive grades for different topics, where n -th-year students
I have the following situation where a client class executes different behavior based on
I have a situation that I solved in the following way: //cube_potentials is float8
I have an interesting situation that EMF forced me into: abstract class AbstractDog{ ...
I have a situation that requires redirecting users who are already logged in away
I’m in the situation that I have to design and implement a rather big
The Situation I've been hit with a situation that I've never encountered before. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.