|
Texturing Only Part Of The Sphere |
Scooter
Member #16,799
January 2018
|
Hi all: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Scooter, it's called sphere mapping. It's been done before, you just have to know what you're talking about. I ran your example code, and it works fine, the marios are plastered on the outside of the sphere in a quad. What did you expect? They won't map to the sphere unless you use a shader. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
jmasterx
Member #11,410
October 2009
|
Edgar Reynaldo said: it's called sphere mapping. It's been done before, Wait.... you mean to tell me people have made spheres with more than one texture I thought Scooter was really on to something here with these multitextured spheres. Can't believe it's been done before Agui GUI API -> https://github.com/jmasterx/Agui |
Scooter
Member #16,799
January 2018
|
Edgar: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
The inherent problem is that triangles are flat and coplanar and the surface of a sphere is not. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Scooter
Member #16,799
January 2018
|
Edgar: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
For a small example of what this problem entails, look up the Mercator Projection. It's the classic reverse of this problem, projecting a sphere onto a rectangle. Since you have pentagons, you can paste your texture onto your pentagon, as long as you don't draw over the edge of the polygon, you're fine. I should be able to adapt your soccer ball demo to use mario on a few of the pentagons in a little while. {"name":"612336","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/c\/fc347f54e755d602748eca7ce02c11c6.png","w":256,"h":256,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/c\/fc347f54e755d602748eca7ce02c11c6"} EDIT Source file attached and image file as well. {"name":"612339","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/4\/549aa907c7e7dec2f71ab7d075b883f9.png","w":640,"h":360,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/5\/4\/549aa907c7e7dec2f71ab7d075b883f9"} My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Scooter
Member #16,799
January 2018
|
Edgar: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
It's saved as C++. You could probably resave it as C and compile it with gcc. But it works just fine with g++. You have to link to allegro and opengl. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|