Quote: "..It's possible?
is there a command to know the 3D coords of a determinate pixel of a texture? or just do you have some good idea about?"
Yes , look the
POINT(X,Y) command
This piece of code shows you how we put 50 objects randomly on the floor, and then we make an image to save all the objects coordinates.
autocam off
sync on
start:
`reseting all
for i= 1 to 1000
if object exist(i) then delete object i
next i
`floor
make object box 1000,600,0,600:color object 1000,rgb(0,0,100)
position object 1000,300,0,300
`50 objects
for i= 1 to 50
make object box i,8,8,8
position object i,rnd(600),0,rnd(600)
next i
ink rgb(0,0,0),0
box 0,0,100,100
ink rgb(255,255,255)
`painting position of objects in an image of 100 * 100
for i= 1 to 50
dot object position x(i)/6,100-object position z(i)/6
next i
get image 1,0,0,100,100,1
position camera 0,1000,0
point camera 0,0,0
cam#=65
do
set cursor 200,0
ink rgb(255,255,0),0
print "Press Space for new coords."
paste image 1,0,0
if spacekey() then goto start
control camera using arrowkeys 0,0.9,0.9
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
sync
loop
Imaging that you want to make manually all the points in any painting program. This code will make a box for every point in the image. Example attached.
`Note. image must be .Bmp for better reading
autocam off
sync on
SET TEXT FONT "verdana"
SET TEXT SIZE 14
load image "points.bmp",1
paste image 1,0,0
for x= 1 to 100
for z= 1 to 100
col=point(x,z)
if col>0
ob=ob+1
make object box ob,1,3,1
position object ob,x,0,100-z
endif
next z
next x
position camera 50,70,0
point camera 0,0,0
a#=0
cam#=45
do
set cursor 5,5:print ob
a#=wrapvalue(a#+mousemovex())
cam#=wrapvalue(cam#+mousemovey())
control camera using arrowkeys 0,0.1,0.1
rotate camera cam#,a#,0
sync
loop
In the same way, you can put differents colour points and decide that if a colur is white, then you add a tree, and if the colour is red, then you add soldat.
Cheers.
I'm not a grumpy grandpa
