Hi again.
Quote: "If the textures are shared between the objects then yeah"
we can check what texture has every wall to adopt new texture
Heres is an example using a mesh that place where the wall are when we point to them. It needs to be checked but it shows how it works.
autocam off
sync on
hide mouse
color backdrop 0
ink rgb(20,60,20),0
box 0,0,50,50
ink rgb(30,80,30),0
box 5,5,45,45
get image 1,0,0,50,50,1
make matrix 1,100,100,90,90
prepare matrix texture 1,1,1,1
`camera target and object check
make object box 1000,1,1,1
make object box 1001,1,1,10
hide object 1000:hide object 1001
`some walls
make object plain 1,30,20
position object 1,40,10,40
make object plain 2,50,20
yrotate object 2,90
position object 2,55,10,65
make object plain 3,40,20
yrotate object 3,90
position object 3,25,10,20
make object plain 4,40,40
xrotate object 4,90
position object 4,45,20,20
`mesh object
make object plain 80,50,50,30,30
xrotate object 80,90
fix object pivot 80
set object cull 80,0
texture object 80,1
scale object texture 80,12,12
color object 80,rgb(255,255,255)
for i= 1 to 4
texture object i,1
scale object texture i,12,12
set object cull i,0
next i
`liths
hide light 0
set ambient light 10
make light 1
set spot light 1,0,60
set light range 1,100
make light 2
set spot light 2,0,20
set light range 2,100
position camera 80,5,5
do
texture object 80,1
position object 1000,camera position x(),camera position y(),camera position z()
rotate object 1000,cam#,a#,0
move object 1000,2000
tx=object position x(1000)
ty=object position y(1000)
tz=object position z(1000)
for i= 1 to 4
show object i
x=camera position x()
y=camera position y()
z=camera position z()
if intersect object(i,x,y,z,tx,ty,tz)>0
distancia#=intersect object(i,x,y,z,tx,ty,tz)
endif
position object 1001, camera position x(),camera position y(),camera position z()
rotate object 1001,cam#,a#,0
move object 1001,distancia#
if object collision(i,1001)
sx=object size x(i)/object size x(80)*100
sy=object size y(i)/object size y(80)*100
position object 80,object position x(i),object position y(i),object position z(i)
rotate object 80,object angle x(i),object angle y(i),object angle z(i):hide object i
scale object 80,sx,sy,sy
endif
next i
if object collision(1001,0)>0 then show object 80 else hide object 80
a#=wrapvalue(a#+mousemovex()/2)
cam#=wrapvalue(cam#+mousemovey()/2)
rotate camera cam#,a#,0
position light 1,camera position x(),camera position y(),camera position z()
position light 2,camera position x(),camera position y(),camera position z()
rotate light 1,cam#,a#,0
rotate light 2,cam#,a#,0
ink rgb(255,255,0),0
set cursor 315,235
print "o"
set cursor 0,0
print screen fps()
print "PRESS W TO SEE IN WIREFRAME"
if inkey$()="w"
set object wireframe 1,1
set object wireframe 2,1
set object wireframe 3,1
set object wireframe 4,1
set object wireframe 80,1
else
set object wireframe 1,0
set object wireframe 2,0
set object wireframe 3,0
set object wireframe 4,0
set object wireframe 80,0
endif
sync
loop
cheers.
I'm not a grumpy grandpa
