I'm trying to create a model of the Solar System and am currently working on the Sun. I've got this problem of finding a way to make the Sun provide the light for the rest of the scene and be visible itself.
My current approach is to have a light source at (0,0,0) and put my Sun at (0,0,0) as well. This lights up the planets floating around in the distance, but it does not light up the Sun. I'm assuming this is because the light in being reflected internally. Even if it isn't, it still won't light up the Sun because the light never doubles back...
So I've tried emitting light from the Sun to make it visible, but I don't really know how to do it, and have thus far been unsuccessful. Googling for how to emit light hasn't thrown up much help either.
I've had a thought that perhaps there is a way to invert that internally reflected light to have it reflect outwards instead of inwards, but again, I have no idea how to do that in Irrlicht.
I need someone to tell me how to either A) emit light from an object or B) how I actually should be approaching creating a functioning Sun.
Help is much appreciated!
Creating the Sun, emit light, use light source?
-
- Posts: 5
- Joined: Thu Feb 03, 2011 3:51 pm
I'm not the Irrlicht Pro, so i'm sure others can give you better answers. Personally i would make the sun a very light color, almost white, and i would make it unaffected by lights and ensure it to be unshaded. Could be even a billboard with a circle. So no matter how dark your scene is, your sun would always look bright and unshaded. Then i would add some effects that change, the straighter the camera looks towards the sun, like glare and lenseflare.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
If you want to 'fly' around the solarsystem - thus near the sun - just to watch/show how it would be it's maybe best to create a directional light wich always points towards the camera.
This way you can model the sun and create some nice solarflames as Lonesome Ducky shows and the other planets will be lit too.
Hmmm, maybe not updating to the camera but maybe towards the camera its target or where you are viewing -> cast a ray from your eye (midpoint of the screen) straight into the screen until you hit something, that would be the point to aim the directional light to. Same cave-eats can come along I am afraid.
Ain't that impressive a big ball of fire (image above). It's just that unbelievable, And then the time of it that it already burns
This way you can model the sun and create some nice solarflames as Lonesome Ducky shows and the other planets will be lit too.
Hmmm, maybe not updating to the camera but maybe towards the camera its target or where you are viewing -> cast a ray from your eye (midpoint of the screen) straight into the screen until you hit something, that would be the point to aim the directional light to. Same cave-eats can come along I am afraid.
Ain't that impressive a big ball of fire (image above). It's just that unbelievable, And then the time of it that it already burns
No I am no noob, just checking if your not one too
Thanks to Niko and all others that made Irrlicht possible.
Thanks to Niko and all others that made Irrlicht possible.
-
- Posts: 5
- Joined: Thu Feb 03, 2011 3:51 pm
Turning off lighting on the Sun has given me what I want for now. The Sun sits there clear as day, and all the planets are still shrouded in sunlight.
Took me a while to get it working... I was using my Planet class for the Sun (lazy). But of course, the planets are using tangent meshes and what-not. I made a new class just for the Sun and took all that out and it works now.
A billboard won't really work for what I want. Eventually my program will have ships flying around and all sorts. It will need a physical Sun to be crash-into-able...
Took me a while to get it working... I was using my Planet class for the Sun (lazy). But of course, the planets are using tangent meshes and what-not. I made a new class just for the Sun and took all that out and it works now.
A billboard won't really work for what I want. Eventually my program will have ships flying around and all sorts. It will need a physical Sun to be crash-into-able...
for crashing into the sun, can't you better do a boundingsphere check and start burning the plane? as it would still be well quite a distance to the sun after you've burned.
this will only take one radius and one distance to check against
this will only take one radius and one distance to check against
No I am no noob, just checking if your not one too
Thanks to Niko and all others that made Irrlicht possible.
Thanks to Niko and all others that made Irrlicht possible.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium