::TUTORIAL:: Making A Skybox

User avatar
DJ99X
Posts: 15468
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: ::TUTORIAL:: Making A Skybox

Postby DJ99X » Sun May 09, 2010 11:27 am

Oh. I probably should have included that it was done using spherical co-ordinates, so the vector is normalised (magnitude=1)

User avatar
Shadow
Posts: 2753
Joined: Sun Dec 02, 2007 5:10 pm
Team: FSK
Location: Finland

Re: ::TUTORIAL:: Making A Skybox

Postby Shadow » Sun May 09, 2010 11:34 am

DJ wrote:Yeah, I've had the solution for a while now. I just never bothered updating this thread


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. :lol:
Image
Those who possess strength have also known adversity.

mace-x
Posts: 2303
Joined: Wed Jan 02, 2008 5:53 am
Team: your sister´s fan!
Location: candy planet.
Contact:

Re: ::TUTORIAL:: Making A Skybox

Postby mace-x » Wed Jun 30, 2010 3:18 am

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 :)
Image
Massacre ftw!

the human stupidity and the universe are unlimited, and im not totally sure about the universe...

User avatar
yzmxer608
Posts: 15301
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: ::TUTORIAL:: Making A Skybox

Postby yzmxer608 » Fri Jul 16, 2010 5:16 pm

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?

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

Or would it be a math error?
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

User avatar
yzmxer608
Posts: 15301
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: ::TUTORIAL:: Making A Skybox

Postby yzmxer608 » Fri Jul 16, 2010 5:29 pm

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 :?.
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.

User avatar
DJ99X
Posts: 15468
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: ::TUTORIAL:: Making A Skybox

Postby DJ99X » Sat Jul 17, 2010 1:41 am

[0.68 0.52 0.51]

User avatar
yzmxer608
Posts: 15301
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: ::TUTORIAL:: Making A Skybox

Postby yzmxer608 » Sat Jul 17, 2010 2:03 am

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.

User avatar
DJ99X
Posts: 15468
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: ::TUTORIAL:: Making A Skybox

Postby DJ99X » Sat Jul 17, 2010 2:18 am

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 ]

User avatar
DJ99X
Posts: 15468
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: ::TUTORIAL:: Making A Skybox

Postby DJ99X » Sat Jul 17, 2010 2:19 am

Doh, messed that up too

[ -0.092 0.62 0.78 ]

User avatar
yzmxer608
Posts: 15301
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: ::TUTORIAL:: Making A Skybox

Postby yzmxer608 » Sat Jul 17, 2010 2:32 am

I'll try that out, thanks man.

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.

User avatar
DJ99X
Posts: 15468
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: ::TUTORIAL:: Making A Skybox

Postby DJ99X » Sat Jul 17, 2010 2:34 am

What? LOL

User avatar
yzmxer608
Posts: 15301
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: ::TUTORIAL:: Making A Skybox

Postby yzmxer608 » Sat Jul 17, 2010 3:24 am

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.

User avatar
yzmxer608
Posts: 15301
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: ::TUTORIAL:: Making A Skybox

Postby yzmxer608 » Sat Jul 17, 2010 4:51 am

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.

User avatar
DJ99X
Posts: 15468
Joined: Tue Jan 15, 2008 11:36 am
Location: Land Down Under

Re: ::TUTORIAL:: Making A Skybox

Postby DJ99X » Sat Jul 17, 2010 5:34 am

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:

Say 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


Resizing it to 360x360 works good as well, as 1°=1 pixel

User avatar
yzmxer608
Posts: 15301
Joined: Mon Dec 29, 2008 4:30 am
Team: Race Tech/SD
Location: Wisconsin, U.S.A

Re: ::TUTORIAL:: Making A Skybox

Postby yzmxer608 » Sun Jul 18, 2010 8:38 pm

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.


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 47 guests