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 / Its Sherlock Holmes time again - this time a lighting problem

Author
Message
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 21st Sep 2003 20:21
Greetings all

The attached source is a development of arbitrage and indi's code.

Obj 1 is supposed to be a sun. Objs 2 and 3 are a planet and moon respectively.

I've stumped by two mysteries.

1. How come the light source, which is supposed to be inside Obj 1, does not work properly? To see this, just zoom through Obj 1 - the underside of it and the other objs isn't lit at all.

2. How come there are a duplicate set of Objs 1 to 3? To see this, pan the camera through 360 degrees.

I'm a bit baffled. All help, gratefully received.

Phil

What do you mean, bears aren't supposed to wear hats and a tie?
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 22nd Sep 2003 05:06
do u mean something like this mate.?

I shrunk the sizes distances a little to make it a little easier to visualise.



http://www.lunarpixel.com
It's already tomorrow in Australia
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 22nd Sep 2003 19:14
Fraid not Indi.

Your amended code still has both the problems I outlined above. One half of the sun is lit - the other half is darkened!

Also, there are still those weird second set of objects 1 to 3.

Its all very strange.

Philip

What do you mean, bears aren't supposed to wear hats and a tie?
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 22nd Sep 2003 19:55
Ahaha! (He says, in a meaningful way).

I've solved the problem with the dark side of the sun. See attached source.

I'm still baffled by the cloned objects. I can only assume that DB Pro repeats the 3d world matrix after a certain distance.

Now to do something about the sun. Its a bit primitive at the mo.

What do you mean, bears aren't supposed to wear hats and a tie?
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 22nd Sep 2003 20:04
Yes and now I've worked out why I was getting the ghost object names.

Its only taken me a day. Good job I'm not auditioning for "genius of the year" competition. I'd come last, even if I were the only contender.

Its because object screen x and y return values even if an object is not in the screen. Hence the command in question needs to be protected by an if statement. See attached code.

Apologies to all those out there who saw this a day ago and have been secretly laughing at me.

Philip

What do you mean, bears aren't supposed to wear hats and a tie?
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 22nd Sep 2003 20:57
Finally, I've beautified it a bit by adding in a nice sidereal star sphere.

Also, by way of thanks to Indi for his thoughts, I've named a whole planet after him. Now, you really can't say fairer than that.

Wish I could get rid of the annoying The Sun label bug though. I'll sort that out when I fancy doing some trig - probably at the weekend. Anyone who wants to save me this, would be welcome in the park.

Cheerio

Philip

What do you mean, bears aren't supposed to wear hats and a tie?
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 23rd Sep 2003 02:43
good stuff mate, theres a slight difference in classic and pro with the set object triggers. So depending on what one your using some small alterations would be required. It looks like you have solved it anyway.

Ooh err i got a planet named after me. Ive had a pen named after me ages ago but never a planet

http://www.lunarpixel.com
It's already tomorrow in Australia
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 23rd Sep 2003 18:14
You're now a gas giant!

Er, no offence intended.

The rendering of the rings isn't exactly brilliant because the texture is very basic - its just based on the circle command. Right up close you can see straight through them.

The only thing that defeats me is how to make the gas giant cast a shadow over the rings. This would be tres cool. However, two hours later I am temporarily beaten on this one.

Philip

What do you mean, bears aren't supposed to wear hats and a tie?
indi
23
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 25th Sep 2003 03:31
hehe, if u have pro then u could try and deploy set shadow shading on or similar to the way a lense flare maths works u could move a flat plain over that ring plane to represent a shadow.

http://www.lunarpixel.com
It's already tomorrow in Australia
Philip
23
Years of Service
User Offline
Joined: 15th Jun 2003
Location: United Kingdom
Posted: 25th Sep 2003 21:34
I'm a Pro user. I don't have classic. Shadow shading doesn't seem to have any effect, which is a bit odd. I think its because of the distance from the point of ambience. The effect is too muted to be visible.

I'm contemplating create fake clone lights pointing at each planet positioned close to the planet on the vector from the Sun.

If you look in the work in progress forum at the solar system thread, I've just posted the latest version of the code.

Philip

What do you mean, bears aren't supposed to wear hats and a tie?

Login to post a reply

Server time is: 2026-07-25 17:30:47
Your offset time is: 2026-07-25 17:30:47