Pi3D rendering two images on screen problem - Raspberry Pi Forums


just starting pi3d , try show 2 images next each other, code shows 1 picture , other 1 black

code: select all

 display = pi3d.display.create(0,0,1920, 1080, frames_per_second=4) display.set_background(0.2,0,0,1) shader1 = pi3d.shader("uv_flat") shader2 = pi3d.shader("uv_flat") camera = pi3d.camera(is_3d=false) camera.was_moved=false ntex1 = pi3d.texture("/home/pi/dev/images/1.jpg", blend=true) pic1 = pi3d.imagesprite(ntex1,  shader1,  w=660.0,  h=1080.0,  x=-660.0, y=0.0, z=5.0) ntex2 = pi3d.texture("/home/pi/dev/images/2.jpg", blend=true) pic2 = pi3d.imagesprite(ntex2,  shader2,  w=660.0,  h=1080.0,  x=660.0, y=0.0, z=6.0)  #mykeys = pi3d.keyboard();  while display.loop_running():      pic1.draw()     pic2.draw()   
seems i'm missing something:
- picture seems centered, why isn't x=0 , y=o not left upper corner. possible make work way?
- why not see 2 pictures rendered 1 black box?

hi, i'm not sure code you're trying do. expect happen:
temp1.jpg
temp1.jpg (11.54 kib) viewed 301 times
i.e. putting centre of image scaled 660 wide 660 left of centre of screen , image 660 right. leave gap of 330 x 2 between them , overall width 660 x 3 = 1980 going 30 pixels off either side of display drawing surface.

images side side touching need -330 , +330

if don't specify dimensions display.create() fill whole of available screen, might option try. can dimensions later positioning thing display.width , display.height.

if imagesprite rendering showing black that's different problem, cause can think of not enough gpu memory. did set to?

ps need 1 instance of each different type of shader can pass multiple objects drawing.


raspberrypi



Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'