Hello,
I have this code:
`TEST!!!
if file exist("point") = 1
open to read 3, "point"
if file open(3) = 1
read string 3, range$
read string 3, pointcolorr$
read string 3, pointcolorg$
read string 3, pointcolorb$
endif
close file 3
//CONVERT LIGHT VALUES
range = val(range$)
pointcolorr = val(pointcolorr$)
pointcolorg = val(pointcolorg$)
pointcolorb = val(pointcolorb$)
//CLEAR OLD LIGHTMAPS
lm clear collision objects
lm clear light map objects
lm clear lights
for objaddcollisionobject = 1 to 100000
if object exist(objaddcollisionobject) = 1
LM Add Collision Object objaddcollisionobject
ENDIF
NEXT objaddcollisionobject
LM Build collision Data
for objaddtolightmap = 1 to 100000
if object exist(objaddtolightmap) = 1
LM Add Light Map Object objaddtolightmap
ENDIF
NEXT objaddtolightmap
lm set ambient light 0.4, 0.4, 0.4
`lm set ambient occlusion on 15, 5, 1
inc lightnum
make object sphere lightnum, 25
position object lightnum, camera position x(0),camera position y(0),camera position z(0)
for addlight = 3155 to lightnum
if object exist(addlight) = 1
LM Add Point Light object position x(addlight),object position y(addlight),object position z(addlight),range,pointcolorr,pointcolorg,pointcolorb
endif
NEXT addlight
delete file "point"
ENDIF
The idea is that through this code i want to create multiple lights and position them at the objects spheres created to represent the lights in the scene. However, they don't position to those objects, sometimes i think they are not even created multiple times and sometimes they are placing in the same position of one object that represents the lights; maybe is a problem with the for loop that creates the lights?
Thank You!
Alex Matei CEO
www.alexmatei.com