@bn2
I don't have access to DB at the moment but I'll try to knock together an example without testing it. And 'glow' isn't quite the word. More like, light up with the set light/material color:
set display mode 800,600,32
sync on
sync rate 60
autocam off
hidemouse
rem main
_main:
gosub _lighting
gosub _init
do
gosub _move_camera
sync
loop
end
_init:
rem make matrix for ground reference
make matrix 1,1000,1000,25,25
rem make a few objects
for obj=1 to 20
make object sphere obj,25
position object obj,rnd(1000),13,rnd(1000)
remstart
you could control the objects light intensity with
a variable or something. This intensity could be a
color or maybe a heat index - the hotter the brighter or the
more red or something.
For this example, I'm just going to set a random diffuse.
Diffuse is a material setting that controls what color of
light is spread out on the surface of an object. It's the
color the object reflects back. If the object has 0 diffuse,
the object will look like a sillouette - without any detail.
If you want the object to eminate a particular color -
that is sort of glow even when there is no light, use
Emissive. Emissive controls the innate intensity/color
of light from the object. It doesn't need a light source
to reflect back.
I'm only going to control Diffuse in this example because I
want the object to respond to the light that I shine on it.
remend
rem varying intensities of green
set object diffuse obj,rgb(0,rnd(192)+63,0)
next obj
rem create an object with which to control a directional light
litobj=100
make object plain litobj,1,1
hide object litobj
rem make sure object shares the camera's rotation order
set object rotation zyx litobj
return
_lighting:
rem just make it dark so the lighting can be seen on the objects
color ambient light 0
rem light 0 is the default directional light for the scene
rem so we can change it's color or leave it alone.
rem I'll make sure it's at 100% intensity
color light 0,255,255,255
return
_move_camera:
yang#=wrapvalue(camera angle y()+mousemovex())
yrotate camera yang#
move camera (upkey()-downkey())*5
camx#=camera position x()
camy#=20
camz#=camera position z()
rem position the directional light control object
position object litobj,camx#,camy#,camz#
set object to camera orientation litobj
move object litobj,10
rem position a directional light based on the vector of litobj
vx#=object position x(litobj)-camx#
vy#=object position y(litobj)-camy#
vz#=object position z(litobj)-camz#
set directional light 0,vx#,vy#,vz#
return
This code should point the directional light 0 in whatever direction the camera is facing. Each object should have a random intensity of green and should light up according to the diffuse setting. Play with ambient diffuse and emissive to try and reach the desired effects. Emissive is the all around glow emitted directly from the object that doesn't need a light source. Diffuse is the surface color reflected directly from the object, ambient is the objects response to area outside light. This differs from diffuse because it is the intensity of the light striking the surface of the object, not the light that is reflected back. you'll have to play with both to see the varying effects. Also check out the sticky - DBC 1.20 controls explained for some insight on these material controls.
Enjoy your day.