Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
I'm new to OpenGL and it has quite the learning curve so I'd really appreciate a bit of help.
What I am attempting to accomplish:
I need to create a sphere (that doesn't move) and add a UIScrollView on top of it. Basically I would be using half of the sphere. If anyone is familiar with the abc news app, they have that globe on the main page that has videos spinning around it. I want to mimic that. I can't surround the globe with images so I have to get a UIScrollView to conform to that sort of morphed-half sphere shape.
I feel I can create a sphere from scratch using OpenGL but laying any views on this doesn't work at all. Am I able to grab the EAGLayer (or whatever it was called) of a UIScrollView and use this to morph it into a sphere?
Precise code is always preferred but I realize everyone has lives (hopefully) :) So what I'm REALLY attempting to gain from this question is simply a push in the right direction such as "Yes, you can simply morph the layer and that will give you the EXACT effect you want." because I feel like I keep going off in the wrong direction.
Here is an image of what I am trying to accomplish...
I'm new to OpenGL and it has quite the learning curve so I'd really appreciate a bit of help.
What I am attempting to accomplish:
I need to create a sphere (that doesn't move) and add a UIScrollView on top of it. Basically I would be using half of the sphere. If anyone is familiar with the abc news app, they have that globe on the main page that has videos spinning around it. I want to mimic that. I can't surround the globe with images so I have to get a UIScrollView to conform to that sort of morphed-half sphere shape.
I feel I can create a sphere from scratch using OpenGL but laying any views on this doesn't work at all. Am I able to grab the EAGLayer (or whatever it was called) of a UIScrollView and use this to morph it into a sphere?
Precise code is always preferred but I realize everyone has lives (hopefully) :) So what I'm REALLY attempting to gain from this question is simply a push in the right direction such as "Yes, you can simply morph the layer and that will give you the EXACT effect you want." because I feel like I keep going off in the wrong direction.
Here is an image of what I am trying to accomplish...
Any help is much appreciated! Thanks.
No, that won't work. Layers are flat 2D objects that you can move and rotate in 3D, but you can't bend them in 3D.
To do that, you'll have to capture the pixels from a layer as an image, convert it to an OpenGL texture, and map the texture onto your half-globe. Depending on what you are trying to display, it might be faster and easier to skip the layer and do all the rendering directly in OpenGL.
Regards,
Duncan C WareTo
Animated GIF created with Face Dancer, available for free in the app store.
No, that won't work. Layers are flat 2D objects that you can move and rotate in 3D, but you can't bend them in 3D.
To do that, you'll have to capture the pixels from a layer as an image, convert it to an OpenGL texture, and map the texture onto your half-globe. Depending on what you are trying to display, it might be faster and easier to skip the layer and do all the rendering directly in OpenGL.
Duncan, thank you for the response. That alone will save me a ridiculous amount of time because I thought I was on the right track.
However, I'm not 100% clear on the second part. Are you saying that I need to have a regular scrollview that I take pictures of constantly, morph the picture, and display it on the globe (since only textures can be displayed)? Is OpenGL fast enough for that to the point where it will still look smooth? Or is there a way to actually get a morphed UIScrollView? It sounds to me like I can't morph the scroll view if I need to have an image converted into a texture, which needs to be mapped onto a sphere object already created in OpenGL.
So I'll start working on the first method, assuming it is fast enough, while I await confirmation. Thank you SO much for the response.
Duncan, thank you for the response. That alone will save me a ridiculous amount of time because I thought I was on the right track.
However, I'm not 100% clear on the second part. Are you saying that I need to have a regular scrollview that I take pictures of constantly, morph the picture, and display it on the globe (since only textures can be displayed)? Is OpenGL fast enough for that to the point where it will still look smooth? Or is there a way to actually get a morphed UIScrollView? It sounds to me like I can't morph the scroll view if I need to have an image converted into a texture, which needs to be mapped onto a sphere object already created in OpenGL.
So I'll start working on the first method, assuming it is fast enough, while I await confirmation. Thank you SO much for the response.
OpenGL only comes into play once you have the contents loaded into a texture.
The question is whether or not your code to capture your scrollview as a bitmap and load it as a texture will be fast enough. If the contents of the scrollview are static then yes, it should be fine. Load the pixels, then display them and manipulate them in OpenGL as needed.
If on the other hand you want to display "live" content" from the scroll view, it probably won't be fast enough.
Regards,
Duncan C WareTo
Animated GIF created with Face Dancer, available for free in the app store.
OpenGL only comes into play once you have the contents loaded into a texture.
The question is whether or not your code to capture your scrollview as a bitmap and load it as a texture will be fast enough. If the contents of the scrollview are static then yes, it should be fine. Load the pixels, then display them and manipulate them in OpenGL as needed.
If on the other hand you want to display "live" content" from the scroll view, it probably won't be fast enough.
I will know the complete contents of my scrollview, it won't need to change at all while spinning and will simply load in from an array. It will need to have the illusion that it is looping and going on forever though.
I'll continue to make slow progress on this. I'm hoping to have it completed by the end of the week since I'm still learning OpenGL and have other projects I'm working on simultaneously. I'll post back if this method was successful. In the mean time, if anyone else has any other ideas - I'd be happy to hear them. This one seems like such a roundabout way of achieving my goal. (And I don't want straight images that give the "illusion" of a curved one. It just never looks right).
I will know the complete contents of my scrollview, it won't need to change at all while spinning and will simply load in from an array. It will need to have the illusion that it is looping and going on forever though.
I'll continue to make slow progress on this. I'm hoping to have it completed by the end of the week since I'm still learning OpenGL and have other projects I'm working on simultaneously. I'll post back if this method was successful. In the mean time, if anyone else has any other ideas - I'd be happy to hear them. This one seems like such a roundabout way of achieving my goal. (And I don't want straight images that give the "illusion" of a curved one. It just never looks right).
Thanks again Duncan.
There was too much overhead for me with switching images constantly. I decided to instead go with using a single texture and doing any editing inside the fragment shader since it uses the graphics chip thats built for speed.
Replies
To do that, you'll have to capture the pixels from a layer as an image, convert it to an OpenGL texture, and map the texture onto your half-globe. Depending on what you are trying to display, it might be faster and easier to skip the layer and do all the rendering directly in OpenGL.
Duncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeHowever, I'm not 100% clear on the second part. Are you saying that I need to have a regular scrollview that I take pictures of constantly, morph the picture, and display it on the globe (since only textures can be displayed)? Is OpenGL fast enough for that to the point where it will still look smooth? Or is there a way to actually get a morphed UIScrollView? It sounds to me like I can't morph the scroll view if I need to have an image converted into a texture, which needs to be mapped onto a sphere object already created in OpenGL.
So I'll start working on the first method, assuming it is fast enough, while I await confirmation. Thank you SO much for the response.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe question is whether or not your code to capture your scrollview as a bitmap and load it as a texture will be fast enough. If the contents of the scrollview are static then yes, it should be fine. Load the pixels, then display them and manipulate them in OpenGL as needed.
If on the other hand you want to display "live" content" from the scroll view, it probably won't be fast enough.
Duncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI'll continue to make slow progress on this. I'm hoping to have it completed by the end of the week since I'm still learning OpenGL and have other projects I'm working on simultaneously. I'll post back if this method was successful. In the mean time, if anyone else has any other ideas - I'd be happy to hear them. This one seems like such a roundabout way of achieving my goal. (And I don't want straight images that give the "illusion" of a curved one. It just never looks right).
Thanks again Duncan.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome:)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome