Andrea Viarengo
2007-10-24 10:48:59 UTC
Hi,
I post a little piece of lua code that show the bug concerned cached image,
could be useful for debug:
You can start from a new project, I used only 2 image file "white.png" and "
black.png" both
512x512 and with just one color inside
----------------------------------------------------------------------------------------------------------------
cubic {"white.png","white.png","white.png","white.png","white.png","
white.png"}
function draw(t)
dimx,dimy=t.image:size()
p=patch {face=3,nw=2,nh=2,anchorv=dimy/2,anchorh=dimx/2,
x=0,y=0,
ny=t.height,nz=t.distance,nx=t.lateral,
visible=true,
image=t.image}
end
pipmak.setverticalfov(80)
-- draw a RED square in the middle of face 3
img=pipmak.loadimage("black.png")
img:color(1,0.5,0.5,1):fill()
draw{distance=4,lateral=0,height=0,image=img}
-- draw a BLACK square at the left of red square
img2=pipmak.loadimage("black.png")
draw{distance=4,lateral=2,height=0,image=img2}
-- draw a BLACK square at the right of red square
img3=pipmak.loadimage("black.png")
draw{distance=4,lateral=-2,height=0,image=img3}
-- draw a RED square above the first red square
img4=pipmak.loadimage("black.png")
-- next statement show the bug:
-- all the square become red!!!! Why?????
img4:color(1,0.5,0.5,1):fill()
draw{distance=4,lateral=0,height=2,image=img4}
----------------------------------------------------------------------------------------------------------------
With this code you should get 2 squares red and 2 squares black, but instead
you get 4 squares red!!!!
You can see the result in picture 1
If you comment-out last 2 lines the bug disapear, as you can see in picture
2
Bye.
Andrea
I post a little piece of lua code that show the bug concerned cached image,
could be useful for debug:
You can start from a new project, I used only 2 image file "white.png" and "
black.png" both
512x512 and with just one color inside
----------------------------------------------------------------------------------------------------------------
cubic {"white.png","white.png","white.png","white.png","white.png","
white.png"}
function draw(t)
dimx,dimy=t.image:size()
p=patch {face=3,nw=2,nh=2,anchorv=dimy/2,anchorh=dimx/2,
x=0,y=0,
ny=t.height,nz=t.distance,nx=t.lateral,
visible=true,
image=t.image}
end
pipmak.setverticalfov(80)
-- draw a RED square in the middle of face 3
img=pipmak.loadimage("black.png")
img:color(1,0.5,0.5,1):fill()
draw{distance=4,lateral=0,height=0,image=img}
-- draw a BLACK square at the left of red square
img2=pipmak.loadimage("black.png")
draw{distance=4,lateral=2,height=0,image=img2}
-- draw a BLACK square at the right of red square
img3=pipmak.loadimage("black.png")
draw{distance=4,lateral=-2,height=0,image=img3}
-- draw a RED square above the first red square
img4=pipmak.loadimage("black.png")
-- next statement show the bug:
-- all the square become red!!!! Why?????
img4:color(1,0.5,0.5,1):fill()
draw{distance=4,lateral=0,height=2,image=img4}
----------------------------------------------------------------------------------------------------------------
With this code you should get 2 squares red and 2 squares black, but instead
you get 4 squares red!!!!
You can see the result in picture 1
If you comment-out last 2 lines the bug disapear, as you can see in picture
2
Bye.
Andrea