Hey Chris. I'm pretty sure you and I have chatted via email in the past. There is a post in the WIP board for TOWER CAB. I've been back and forth with this. First wrote it using DarkGDK.NET. Then realized none of the addons worked in VB.NET. So, I opted to try to use the Dark GDK by Mistrel with Purebasic. A problem then surfaced where the sprites used for the foreground interface objects were not be created properly. So, I opted to just use DarkBasic Professional now just as it is, and forget about all the others.
So, here is the code where I created the lights.
open to read 1, "taxilights.dat"
while file end(1)=0
read string 1, tcolor$
read string 1, x$
read string 1, y$
select tcolor$
case "BLUE"
TempX# = Val(x$) - 0.1
TempY# = Val(y$) - 0.2
TempAngle# = AngleToCenter(TempX#, TempY#) + 180
ARRAY INSERT AT BOTTOM BlueLights(0)
ObjID = NextFreeID()
Instance Object ObjID, OneBlueLight
Position Object ObjID, TempX#, 0, TempY#
Rotate Object ObjID, 0, TempAngle#, 0
Set Object Transparency ObjID, 3
Set Object Ambient ObjID, 0
Set Object Emissive ObjID, WhiteColor
BLIGHTCOUNT = Array count (Bluelights(0))
Bluelights(BLIGHTCOUNT) = ObjID
endcase
case "RED"
TempX# = Val(x$) - 0.1
TempY# = Val(y$) - 0.2
TempAngle# = AngleToCenter(TempX#, TempY#) + 180
ARRAY INSERT AT BOTTOM RedLights(0)
ObjID = NextFreeID()
Instance Object ObjID, OneRedLight
Position Object ObjID, TempX#, 0, TempY#
Rotate Object ObjID, 0, TempAngle#, 0
Set Object Transparency ObjID, 3
Set Object Ambient ObjID, 0
Set Object Emissive ObjID, WhiteColor
RLIGHTCOUNT = Array count (Redlights(0))
Redlights(RLIGHTCOUNT) = ObjID
endcase
case "WHITE"
TempX# = Val(x$) - 0.1
TempY# = Val(y$) - 0.2
TempAngle# = AngleToCenter(TempX#, TempY#) + 180
ARRAY INSERT AT BOTTOM WhiteLights(0)
ObjID = NextFreeID()
Instance Object ObjID, OneWhiteLight
Position Object ObjID, TempX#, 0, TempY#
Rotate Object ObjID, 0, TempAngle#, 0
Set Object Transparency ObjID, 3
Set Object Ambient ObjID, 0
Set Object Emissive ObjID, WhiteColor
WLIGHTCOUNT = Array count (Whitelights(0))
Whitelights(WLIGHTCOUNT) = ObjID
endcase
endselect
endwhile
close file 1
To explain what is going on here, the file for the light data was created from AutoCAD. I manually placed a symbol for each colored light over a backdrop of the scene (GOOGLE Earth). I then exported all of those symbols to a text file that contains the color name, x/y coordinates of each light.
So, I read them in, sorting on color name. I then calculate the angle from each point to where the tower cab will be. Each plain is rotated to face the tower cab. Since the tower cab is fixed, and the camera only rotates left/right, using the billboard method was perfect to give the illusion of 3d.
I then set each light to glow on their own. So when the ambient light level goes from day to night, it appears that the lights are on. But, they are set to always be on. I thought about having the user actually do something (Press L) to turn the lights on/off. But its not that big of a deal. I can just say that are controlled by a photocell.
If you can see a cleaner way to write this, I'm open to ideas. I've used a slightly longer way to code this to help me keep it clear in my head.
Here is the link to my WIP post
http://forum.thegamecreators.com/?m=forum_view&t=198407&b=8#top
Thanks everyone.