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.

Newcomers DBPro Corner / ok a question

Author
Message
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 2nd Apr 2003 18:55
ok i havent figured this one out yet guys

i want to make a light above my character that shines in a circle around him
(a light radius) but i havent been able to figure out the spot light or directional light commands yet

someone good with lights wanna gimme a hand?
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 2nd Apr 2003 20:53
does anyone use these lights in their games?
i really would like to add some nice effects with lighting but i just cant seem to get the spot and directional lights to work
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 3rd Apr 2003 02:26 Edited at: 3rd Apr 2003 02:28
Do you want a shaft of light, or do you want the character to glow? It's easier if you want a glow, because then all you have to do is place a point light at the centre of the character.

As for the shaft of light, you'd need to place a spotlight above the character and point it down towards him. Try this bit of code:



Now then, this assumes that your character object is object 1. You can change this easily, as well as the angles of the spotlight, which determine what area it will illuminate, and the height offset of the spotlight. It might also improve the effect if you use a volumetric object to create a bit of glow around the object.

I haven't actually tested this code but, hopefully, it should work alright.

"I am a living, thinking entity who was created in the sea of information."
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 3rd Apr 2003 05:38
hmm it doesnt seem to be doing anything

the same problem i had when i was testing the commands out
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 3rd Apr 2003 06:46
How odd. I do believe that there are some bugs with the lighting engine, though - I have problems crop up occasionally. Just cross your fingers that the wonderful, generous people at DBS are going release another patch for DBClassic!

"I am a living, thinking entity who was created in the sea of information."
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 3rd Apr 2003 15:28
great...
xmen
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 4th Apr 2003 01:15
`try this


sync on
make object cube 1,1
make light 1


color light 1,rgb(255,0,0)
set ambient light 35

do

position light 1,object position x(1),object position y(1)+60,object position z(1)
set light to object position 0,1
set light to object orientation 0,1

zrotate object 1,wrapvalue(object angle z(1)+1)
xrotate object 1,wrapvalue(object angle x(1)+1)

sync
loop
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Apr 2003 06:35
this example might help you


on this line
set spot light 1,45,90

the 45 and 90 are the angles of the two cones of light paramters.

change the 90 to 180 for a different result.





matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 4th Apr 2003 07:11
xmens code is the only one working so far but i cant figure out how to make it stop swinging around all the time (if you test it you know what im talking about)

for some reason when i use the spot light command it doesnt make any light at all but that is what i would like to use...
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Apr 2003 09:30
what video card do u have mate?

does the light example demos work>?

what DB version are u using again

matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 4th Apr 2003 14:55
i have a geforce4 mx
and im usin dbclassic 1.13
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 4th Apr 2003 21:44
that snippet runs in DB 113 here on a tnt2m64.

u might want to update your video driver

the only difference was that DBPs matrix setting is reversed
so in DB 113 the matrix appears to be in a wireframe state.

I can still see the light tho and its not hard to change that flag.

matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 5th Apr 2003 00:14
umm the problem im having with the code now is not that i cant see the light, its that it doesnt stay contant, it keeps swinging around and facing different directions...
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 5th Apr 2003 05:05
i think i figured out whats wrong, it it not possible to make the light affect the ground?

right now its only afffecting the walls of my level but the ground stays the same
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Apr 2003 06:23
set matrix and set object flag the light and amience commands that usually help make something appear to be lit up.

matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 5th Apr 2003 06:58
that would work if i was using a matrix im sure....

ok so now i have light sometimes, i nice circle around the character
which is what i wan

problem now is it only appears in certain places

what i mean is it will show up for a second then it will be gone, ill walk around a little and it might show up again for a second...

i can send a demo if anyone wants to see what i mean
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Apr 2003 07:14
set matrix for matrices

set object for objects

sure post a sample

matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 5th Apr 2003 15:32
once again im not using matrixes

and theres way too much to post it
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 5th Apr 2003 20:12
You can do it with .x models too, but they need to be reasonably high poly to look any good, the shadowing acts on an entire face. so if you're on giant 2 poly plane, the shadow/light is dispersed over a huge distance

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.
matt rochon
21
Years of Service
User Offline
Joined: 15th Mar 2003
Location: Canada
Posted: 5th Apr 2003 21:08
im usinf plains for the floor and cubes for the wall

i dont know why the light is appearing and disappearing

Login to post a reply

Server time is: 2024-09-20 03:38:42
Your offset time is: 2024-09-20 03:38:42