::TUTORIAL:: Making A Skybox
Re: ::TUTORIAL:: Making A Skybox
Oh. I probably should have included that it was done using spherical co-ordinates, so the vector is normalised (magnitude=1)
Re: ::TUTORIAL:: Making A Skybox
Thanks a f*cking lot! I just spent 3 and a half hours trying to figure out why I couldn't get the flare into the sun's position.DJ wrote:Yeah, I've had the solution for a while now. I just never bothered updating this thread
Those who possess strength have also known adversity.
-
- Posts: 2303
- Joined: Wed Jan 02, 2008 5:53 am
- Team: your sister´s fan!
- Location: candy planet.
Re: ::TUTORIAL:: Making A Skybox
DJ, thanks a lot for this, i´ve never looked at it and damn!, it´s so usefull and you can create some AWESOME! environments.
thanks man, it´s really appreciated
thanks man, it´s really appreciated
Massacre ftw!
the human stupidity and the universe are unlimited, and im not totally sure about the universe...
Re: ::TUTORIAL:: Making A Skybox
I'm having a problem getting my sunflare to work. I can't figure out why it's not showing. Is there something wrong with the lighting file?
Or would it be a math error?
Code: Select all
sun_vector [ -1.00 .79 .99 ]
sun_color [ 1.00 0.78 0.50 ]
ambient [ 0.25 0.25 0.50 ]
sky_n @hillbrookraceway/sky-n.png
sky_e @hillbrookraceway/sky-e.png
sky_s @hillbrookraceway/sky-s.png
sky_w @hillbrookraceway/sky-w.png
sky_u @hillbrookraceway/sky-u.png
sky_env @hillbrookraceway/sky-env.png
flare_element [ 0.0 1.0 ] [ 1.0 0.64 0.29 ] 1.0 @hillbrookraceway/skysunsetflare.png
flare_vector [ -1.00 .79 .99 ]
fog [0.67 0.66 0.70] .001
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: ::TUTORIAL:: Making A Skybox
Sun Heading: 186.75 (Q3)
Sun Altitude: 38.25
Must have something to do with that post Shadow made, but it looks like the sun is on the West image, but the sun heading is in quadrant 3, which Shadows says nothing about in that explanation for West .
Sun Altitude: 38.25
Must have something to do with that post Shadow made, but it looks like the sun is on the West image, but the sun heading is in quadrant 3, which Shadows says nothing about in that explanation for West .
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: ::TUTORIAL:: Making A Skybox
[0.68 0.52 0.51]
Re: ::TUTORIAL:: Making A Skybox
How'd you get that? I have to be doing something wrong somewhere.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: ::TUTORIAL:: Making A Skybox
I use modified spherical co-ordinate equations. Convert the heading angle to a proper catesian angle (in your case, it is -96° [number should never exceed 180 or -180]). Then, use these equations:
x=cos(altitudeangle)*cos(headingangle)
y=sin(altitudeangle)
z=-cos(altitudeangle)*sin(headingangle)
So, using altitudeangle=38.25 and headingangle=-96.75, you get a completely different answer to what I gave you... DOH
I used google for a calculator, which uses radians instead of degrees. So make sure you use something which uses degrees.
Should be
[ 0.78 -0.092 0.62 ]
x=cos(altitudeangle)*cos(headingangle)
y=sin(altitudeangle)
z=-cos(altitudeangle)*sin(headingangle)
So, using altitudeangle=38.25 and headingangle=-96.75, you get a completely different answer to what I gave you... DOH
I used google for a calculator, which uses radians instead of degrees. So make sure you use something which uses degrees.
Should be
[ 0.78 -0.092 0.62 ]
Re: ::TUTORIAL:: Making A Skybox
Doh, messed that up too
[ -0.092 0.62 0.78 ]
[ -0.092 0.62 0.78 ]
Re: ::TUTORIAL:: Making A Skybox
I'll try that out, thanks man.
DJ, 30m TC NOW.
DJ, 30m TC NOW.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: ::TUTORIAL:: Making A Skybox
What? LOL
Re: ::TUTORIAL:: Making A Skybox
30 minute track contest on xfire, everyone is uploading now.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: ::TUTORIAL:: Making A Skybox
That didn't work either, I screwed something up somewhere. I'll have to look into it later, thank you for the math though, I appreciate it.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: ::TUTORIAL:: Making A Skybox
Did you use JLV's povray thingy to make it a skybox? If so, post the reflection image. Its easy to work out the vector from that. If you feel like having a go, here are the instructions I had given Garasaki:
Resizing it to 360x360 works good as well, as 1°=1 pixelSay the image is 512x512.
256,256 is straight up (ie centre of the image) ie [ 0 1 0 ]
Anywhere along the edge of the circle is straight down.
Halfway along the radius of the circle is the horizon, eg at 256,384 this will be the horizon in the east direction ie [ 1 0 0 ]
The angle is linear with the pixels. So in a 512 image, 512 pixels is 360 degrees, 256 pixels is 180 degrees, 128 pixels is 90 degrees, 64 pixels is 45 degrees...... etc.......
North is the top, East is the right etc
See if that helps is determining the sun/flare coordinates
Re: ::TUTORIAL:: Making A Skybox
Yeah I used the POV-ray script. I'll try doing it that way, no promises on me being able to do it right though .
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.