"Lynton Towler" <lynton@[EMAIL PROTECTED]
> wrote in message
news:g1u4o1$e1o$1$8300dec7@[EMAIL PROTECTED]
> Hello,
> Thanks for reading.
> In the past I have received help from you guys on this NG and am hoping
> once again you could be so kind.
> I've been working on a 3D Earth type program using OpenGL with GLUT.
> Currently I load a rather large single texture of the earth and cover
the
> sphere with it, this works OK but is a bit slow at loading.
> I think I need to convert to a tiles approach where I divide the sphere
> into say 512x512 tiles then texture each tile individually to speed
things
> up a little and make future zooming in easier.
> I could then of course load/cache each tile on demand when its within
> view.
> These ideas are nothing new I know but I could really do with a small
> skeleton tutorial or whatever on how to do this so if you know of one
I'd
> really appreciate it.
> I have Googled around a bit and found stuff talking of "Quad Tiles" etc
> but no decent example code.
>
> Thanks in advance
>
> Lynton, England UK
>
> --
>
You have one big texture now, and it works, right ?
So, what if you split the big texture into 2 pieces, with a 1 row (or
column) pixel overlap?
Then, what would you do to the texture coordinates for your sphere?
How about multiply by 2 in that direction, so that 1/2 the way around, you
are at the edge of
texture #1. Then, by extension, the 2nd half of the sphere & second
texture
is easy, right ? Just start over from [0+****ft to 1-****ft]. on the next
texture.
See whay you need to overlap ?. The last/first texure coordinate has to be
1/(2*texture size) ****fted, so that the
"seam" is exactly aligned in the center of the 1st/last texel. You already
did this anyway, right ?
OK, by extension, subdivide in the other direction. If that works', now
you
are home free.
For each of the 4 patches, apply the same alorithm again...& etc.
For extra credit, now what you want to do is start with the big texture
and
sphere #1.
As you zoom in, at some point go to the next level of detail on the
textures
*and* increase the
sphere sampling density. So, when you are zoomed out, you don't have to
load 4/16/64 or whatever textures.
In fact, you don't need a hugely big initial texture. You don't need one
any
bigger than twice the screen resolution., if
you cutoff point is the sphere filling the view****t. You can adjust your
level-of-detail so that the textures are "perfect" given the screen
resolution at that zoom level...
-jbw


|