Ooops
January 20, 2021, 12:49:09 PM

Author Topic: [bb] avi to texture by mongia2 [ 1+ years ago ]  (Read 579 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] avi to texture by mongia2 [ 1+ years ago ]
« on: June 29, 2017, 12:28:41 AM »
Title : avi to texture
Author : mongia2
Posted : 1+ years ago

Description : code for avi to texture

Code :
Code: BlitzBasic
  1. dim camera(0)
  2. dim timer(0)
  3. dim old_mousex(0)
  4. dim old_mousey(0)
  5.  
  6.  
  7. graphics3d 800,600,32,3
  8. setbuffer backbuffer()
  9.  
  10. cleartexturefilters()
  11.  
  12. camera(0)=createcamera()
  13.  
  14. luce=createlight()
  15.  
  16. positionentity luce,0,50,0
  17.  
  18.  
  19. timer(0)=createtimer(30)
  20.  
  21.  
  22. positionentity camera(0),5,5,5
  23.  
  24.  
  25. img=createtexture(512,512,256)
  26. cube=createcube()
  27.  
  28.  
  29. pointentity camera(0),cube
  30.  
  31. while not keydown(1)
  32.  
  33.  
  34. te=millisecs()
  35.  
  36. if keydown(57) and movie=0
  37. movie=1
  38. mov=openmovie("avi/Seq_04.avi")
  39. entitytexture cube,img
  40. showentity cube
  41. endif
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49. if mov>0
  50. drawmovie mov,0,0,512,512
  51. if movieplaying(mov)=0
  52. closemovie(mov)
  53. mov=0
  54. movie=0
  55. hideentity cube
  56.  
  57. endif
  58. endif
  59.  
  60. CopyRect 0,0,512,512,0,0,backBuffer(),textureBuffer(img)
  61.  
  62. temm=millisecs()-te
  63.  
  64. gestione_camera_editor()
  65.  
  66.  
  67. renderworld
  68.  
  69.  
  70.  
  71. old_mousex(0)=mousex()
  72. old_mousey(0)=mousey()
  73.  
  74.  
  75.  
  76.  
  77. flip false
  78. waittimer timer(0)
  79. wend
  80.  
  81. end
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88. function gestione_camera_editor()
  89.  
  90.     dif_x#=old_mousex(0)-mousex()
  91.     dif_y#=old_mousey(0)-mousey()
  92.  
  93.   CamSpd#=1
  94.                 MoveEntity(camera(0), Float(KeyDown(205) - KeyDown(203)) * CamSpd#, 0, Float(KeyDown(200) - KeyDown(208)) * CamSpd#)
  95.  
  96.  
  97.                 If MouseDown(2)
  98.                         TurnSpeed# = 0.8
  99.                 TurnEntity(camera(0), Float(dif_y#)  * TurnSpeed#, 0, 0, False)
  100.                 TurnEntity(camera(0), 0, Float(dif_x#) * TurnSpeed#, 0, True)
  101.  
  102.                 EndIf
  103.  
  104.  
  105.  
  106.  
  107.  
  108. end function


Comments :


John Blackledge(Posted 1+ years ago)

 mongia, you should check out this link:<a href="http://www.blitzbasic.co.nz/Community/posts.php?topic=51214" target="_blank">http://www.blitzbasic.co.nz/Community/posts.php?topic=51214[/url]


Naughty Alien(Posted 1+ years ago)

 ..its usseles...memory leak is still in there...


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal