Skydome mapping
#1
Posted 06 March 2012 - 05:21 AM
Can someone please help me get the proper UV mapping for a skydome such as this one...
https://encrypted-tb...yt50Wu7hvQBuwMs
I've tried the following but isn't looking right!
m = 2 * sqrt(map.x*map.x + map.y*map.y + (map.z+1.0)*(map.z+1.0));
U = ray.dir.x/m + 0.5;
V = ray.dir.y/m + 0.5;
Thanks!
#2
Posted 06 March 2012 - 07:06 AM
#3
Posted 06 March 2012 - 08:09 AM
vec3 ray.dir(x,y,z)...
m = 2 * sqrt( x^2 + y^2 + (z+1.0)^2 );
U = x / m + 0.5;
V = y / m + 0.5;
Thanks.
#4
Posted 06 March 2012 - 09:33 AM
If you convert the x,y,z, of the vert to latitude longitude and scale it to the range 0-1 it should work.
lat = atan2(z,y)
longitude = atan2(x,z)
At least that's what I would try
#5
Posted 06 March 2012 - 03:58 PM
m = sqrt(2.0 * (z + 1.0))
u = 0.5 * x/m + 0.5
v = 0.5 * y/m + 0.5
#6
Posted 06 March 2012 - 05:58 PM
Reedbeta, on 06 March 2012 - 03:58 PM, said:
Is it really? The image looks lile it has the horizon at the edge of the circle. A mirror ball would have the horizon a bit in from the edge, where the angle of the balls surface is 45 deg. and at the edge, where the surface is parallell to the eye ray, the ground behind the ball would be visible.
#7
Posted 06 March 2012 - 06:17 PM
Reedbeta, on 06 March 2012 - 03:58 PM, said:
m = sqrt(2.0 * (z + 1.0))
u = 0.5 * x/m + 0.5
v = 0.5 * y/m + 0.5
This worked perfectly Reedbeta
One more question. Is it possible to set the FOV for the skydome map separatetly from the rest of the model? What I mean is, viewing my model at FOV=35, the sky seems very close. Viewing it at FOV=75 looks much better, I can see the sun. But my model is also viewed at 75. So what I want to do is display the model at 35 but the skydome at 75. Is that possible?
#8
Posted 07 March 2012 - 12:10 AM
Alienizer, you might try using the fisheye equations from this article and see how well that works.
#9
Posted 07 March 2012 - 12:50 AM
Reedbeta, on 07 March 2012 - 12:10 AM, said:
Alienizer, you might try using the fisheye equations from this article and see how well that works.
Actually, it's a skydome. The shot was taken on the ground facing up (90 deg) to the sky, that's why no ground is in the shot. The other equation did not work, but yours does!
It's like this one...
http://www.barnabu.c...in-sketchup.JPG
Here is a big image of the skydome as oppose to the thumbnail I posted...
http://www.tutorials...-MidMorning.png
direct linking not allow, so here is the page...
http://www.tutorials...Sky_Dome_2.html
#10
Posted 21 April 2012 - 03:01 AM
http://sw-in.narod.ru/hdrout.html
Any idea what the correct u,v mapping algo is for this one? Thanks!
#11
Posted 21 April 2012 - 03:34 AM
#12
Posted 21 April 2012 - 03:46 AM
#13
Posted 21 April 2012 - 04:06 AM
#14
Posted 21 April 2012 - 04:33 AM
#15
Posted 21 April 2012 - 08:03 AM
#16
Posted 21 April 2012 - 02:49 PM
#17
Posted 21 April 2012 - 04:18 PM
#18
Posted 21 April 2012 - 08:00 PM
#20
Posted 21 April 2012 - 11:33 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












