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 / issue with lights, seems backwards?

Author
Message
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 15th Feb 2010 23:30
Check out the attached screenshot. My car is pointing towards the light (where the box is). Why is the light coming from the back end?

Attachments

Login to view attachments
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 15th Feb 2010 23:35
code please?
your problem might be because of the ambient light.

bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 16th Feb 2010 00:04 Edited at: 16th Feb 2010 00:04
I turned off ambient light completely and the light highlights were still on the wrong side, here's some relevant code and attached is the entire project (requires BBB GUI from WIP and matrix1utils, and newton):



Attachments

Login to view attachments
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 16th Feb 2010 01:04
lol, I used "SET POINT LIGHT" instead of "POINT LIGHT"

This is how things usually go for me. Thanks anyway

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Feb 2010 01:14 Edited at: 16th Feb 2010 01:15
Quote: "I used "SET POINT LIGHT" instead of "POINT LIGHT""


Oops.

Just looked at the point light Help file:

Quote: "Description

Only spot lights and directional lights can make use of this command. The light number must be specified using an integer value. The coordinates must be specified using real values.
"


How would a directional light use this? A directional light "points at" every point in the world from a particular direction. Perhaps DBPro uses "position" as a direction in this case?
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 16th Feb 2010 03:46
Good point, would have saved me time if I had thought about it

Hawkblood
15
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 16th Feb 2010 20:58
Uhhhh.... Light 0 the default "directional light". I think you may have already figured out the answer, but just in case you haven't: point light 0 in the direction you want and then set the color and the level.... It makes no sense to position the light.

The fastest code is the code never written.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Feb 2010 01:11
You may well be right - but it's not what the Help file says:

Quote: "POINT LIGHT
This command will point an existing light at a location within the scene.

Syntax

POINT LIGHT Light Number, X, Y, Z

Parameters

Light Number

Integer
The light number
X

Float
The x location to point light at
Y

Float
The y location to point light at
Z

Float
The z location to point light at
"


It's quite clearly talking about LOCATIONS not DIRECTIONS.

The Help files are well-known to be infallible ...
Hawkblood
15
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 17th Feb 2010 02:01
Quote: "SET DIRECTIONAL LIGHT
This command will set an existing light to that of a directional light.

Syntax

SET DIRECTIONAL LIGHT Light Number, NX, NY, NZ

Parameters

Light Number

Integer
The light number
NX

Float
The x direction is specified using directional values assuming that the origin of the light is 0,0,0
NY

Float
The y direction is specified using directional values assuming that the origin of the light is 0,0,0
NZ

Float
The z direction is specified using directional values assuming that the origin of the light is 0,0,0 "


I think this is what he needs. The light number is 0 for the default directional light..... You can never use light 0 for anything but directional lighting.

The fastest code is the code never written.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Feb 2010 12:54
Quote: "The light number is 0 for the default directional light..... You can never use light 0 for anything but directional lighting."


Not true.

Try this:



Light 0 is always present by default and is also a directional light by default - but it can be changed (and hidden so it isn't really "present" ).
Hawkblood
15
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 17th Feb 2010 14:32
Quote: "Light 0 is always present by default and is also a directional light by default - but it can be changed (and hidden so it isn't really "present" ). "

Well, that's good to know. I thought I read that it's ONLY directional.... Maybe I misread. But, yes, it can be turned off and the attributes can be changed.

The fastest code is the code never written.

Login to post a reply

Server time is: 2025-06-01 21:12:29
Your offset time is: 2025-06-01 21:12:29