Sphere Mapping Textures

For questions about using Classic.

Post » Mon Apr 16, 2012 2:00 am

yeah, that's a good technique newt. the point of this whole matter though was to use procedurally generated textures (noise2). generating random planets is pretty easy. fire up noise2 a couple of times, load it into a sprite's animation. for every planet, set animation & texure to the 3dobject like you said.
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Mon Apr 16, 2012 6:15 pm

Here is Animmaniac's method tweaked to work with any sized texture. Also fixed an issue with my first example where a seam would show up from the Image manipulator being 0 based and the canvas being 1 based.
http://dl.dropbox.com/u/5426011/examples10/sphereTex3.cap
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Mon Apr 16, 2012 8:28 pm

sry to be so picky, but this can't be right. first, the aspcet ratio does not end up in 2:1. i think that's important for a sphere. second, the equator-pixels are distorted, too.

let me illustrate what i mean:


in addition, it should look something like this qarp, although the poles (top and bottom) have to be shrunk instead of stretched:


i discovered this when using a non pow2, 400px by 400px bitmap in the source-sprite:


the effect gets more the bigger the image gets. pow2 is ok, but non pow2 not.oppenheimer2012-04-16 20:28:52
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Mon Apr 16, 2012 10:39 pm

B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Tue Apr 17, 2012 6:08 pm

[QUOTE=R0J0hound] Fixed it some more:
http://dl.dropbox.com/u/5426011/examples10/sphereTex3b.cap[/QUOTE]

wow Rojo, you're the greatest! i could never have figured out that formular by myself, thank you so much =)

can you briefly explain why you divided the 2nd loop and the first Y by 0.6? my (noobish) guess is that it has something to do with angles.oppenheimer2012-04-17 18:10:09
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Tue Apr 17, 2012 6:54 pm

0.6 is just a scaling factor. It's used in 4 places in events 3 and 4. If you change 0.6 to 1 the image won't cover the entire canvas.
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Tue Apr 17, 2012 7:14 pm

and you found 0.6 by trial and error, or is it just pure knowledge? ;)

my thanks also go to Animmaniac and newt, of course.
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Tue Apr 17, 2012 7:23 pm

It was trial and error. I initially thought the height needed to be doubled or 0.5 but part of the image was cut off, so I tweaked it till I found a value that was close enough to look right.
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Wed Aug 07, 2013 6:28 pm

How does this work with 360 HDR images?
http://www.hdrmill.com/Freebies.htmblackshore2013-08-07 18:29:35
B
5
Posts: 8
Reputation: 249

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests