Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Creating light in all directions?

Author
Message
mhack2
22
Years of Service
User Offline
Joined: 10th Oct 2003
Location: USA, Earth, Sol[0,0]
Posted: 30th Oct 2003 17:28
Guys,

What is a best way to create a sun that shines in all directions like if you have 4 planets on each side of a sun they all be illuminated on a side facing the sun..

I use default point light that sits at 0,0,0 has huge range but it has to have a direction(0,1,0), so planets in other directions (for example 0, -1,0) are not lighted?

Thanks,
Arseny
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 30th Oct 2003 18:49 Edited at: 30th Oct 2003 18:49
Do not set light direction it is not needed



System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 30th Oct 2003 19:18 Edited at: 30th Oct 2003 19:29
I forgot to make the sun shine



System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 30th Oct 2003 21:29
Version 3 sun is coloured by light added shadow on moon



I'm bored what can I tell you

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
mhack2
22
Years of Service
User Offline
Joined: 10th Oct 2003
Location: USA, Earth, Sol[0,0]
Posted: 30th Oct 2003 22:14
Thanks for that stuff, as soon as I get home I'm going to try it..

The only thing that I worry about is that even if you don't set direction it still has some values to it (or maybe I would set 0,0,0?)

In my program I just read values assigned by default to light 0 after creation.. and they were set already to 0,1,0 or something like that..

But I'll try your way..
mhack2
22
Years of Service
User Offline
Joined: 10th Oct 2003
Location: USA, Earth, Sol[0,0]
Posted: 31st Oct 2003 02:43
Thank you!
Very nice code..
Now I can have all my lighting

Found another bug in DBPro 5.1b..

If you scale your object it gradually looses it's lighting ability and then at 1000% is not lighted at all.. check this out:
Quote: "
make light 1

Position Light 1, 0,0,0
color light 0,RGB(0,0,0)
set ambient light 0

Make object sphere 1, -100

Make object Sphere 2,10
scale object 2, 1000, 1000, 1000
Make Object Sphere 3,15

Position Object 2, 100,0,0

Glue object to limb 2,1,0

Position Object 3, -100,100,0

Glue Object to Limb 3,1,0


Position Camera 0, 300,0,0

Point camera 0,0,0,0

color object 1,RGB(255,255,0)
color object 2,RGB(255,0,128)
color object 3,RGB(0,128,255)

rem fade object 1, 10

do
inc a
Rotate Object 1, 0,a,0
sync
loop


"


I saw a post about this some where on this board, guy had bunch of cubes with different scales and they were lit differently..

But anyway thanks for help, btw why do you use -100 size?
mhack2
22
Years of Service
User Offline
Joined: 10th Oct 2003
Location: USA, Earth, Sol[0,0]
Posted: 31st Oct 2003 02:52
BTW, I the shadow on moon doesn't work for me.. nVidia 16Mb..DX9.0b
Moon stays black all the time..
Codger
23
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 31st Oct 2003 02:59
Does your card support hardware shading

p.s. The shadow is on the planet being circled by the moon

System
PIII 650 MZ H.P. Pavillion
394 Mem GeForce 4 400MX
mhack2
22
Years of Service
User Offline
Joined: 10th Oct 2003
Location: USA, Earth, Sol[0,0]
Posted: 31st Oct 2003 16:20
I don't know.. it there a way to find out?

Login to post a reply

Server time is: 2026-07-26 13:02:10
Your offset time is: 2026-07-26 13:02:10