Advertisement
c3d

YouCube demo on Tao Presentations

c3d
Nov 23rd, 2011
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | None | 0 0
  1. import VLCAudioVideo
  2. import Animate
  3.  
  4. AngleX -> 0.0
  5. SpeedX -> 1.0
  6. MouseX0 -> 0.0
  7. AngleY -> 0.0
  8. SpeedY -> 1.0
  9. MouseY0 -> 0.0
  10.  
  11. page "YouCube Scrat!",
  12. Scrat -> "http://youtube.com/watch?v=bKpPTq3-Qic"
  13. Scrat2 -> "http://www.youtube.com/watch?v=RbsGWNXZ51I"
  14. Scrat3 -> "http://www.youtube.com/watch?v=n0ykM1ALggE"
  15. IceAge2 -> "http://www.youtube.com/watch?v=s0ITs4W3yjA"
  16. IceAge3 -> "http://www.youtube.com/watch?v=dfjcECDxuy4"
  17. IceAge4 -> "http://www.youtube.com/watch?v=A3FDoz7KWk8"
  18. video_cube Scrat, Scrat2, Scrat3, IceAge2, IceAge3, IceAge4
  19.  
  20. video_cube V1:text, V2:text, V3:text, V4:text, V5:text, V6:text ->
  21. enable_selection_rectangle false
  22. clear_color 0, 0, 0.1, 1
  23. scale3 S:real -> scale S, S, S
  24. scale3 window_height / 1200
  25. if mouse_buttons <> 0 then
  26. SpeedY := (mouse_x - MouseX0) * 0.01
  27. SpeedX := (MouseY0 - mouse_y) * 0.01
  28. else
  29. MouseX0 := mouse_x
  30. MouseY0 := mouse_y
  31. if page_time < 0.2 then
  32. movie_only ""
  33. locally
  34. translate 300 * sin (0.05 * time) , 200 * cos (0.03317 * time) , -8000
  35. color "white", 0.3
  36. image 0, 0, 3, 3, "Clouds3.png"
  37. locally
  38. translatez 1000
  39. rotatex AngleX
  40. rotatey AngleY
  41.  
  42. play V1, 0, 0, -1
  43. play V2, 0, 90, -1
  44. play V3, 0, 180, -1
  45. play V4, 0, -90, -1
  46. play V5, 90, 0, -1
  47. play V6, -90, 0, -1
  48.  
  49. play V1, 0, 0, 1
  50. play V2, 0, 90, 1
  51. play V3, 0, 180, 1
  52. play V4, 0, -90, 1
  53. play V5, 90, 0, 1
  54. play V6, -90, 0, 1
  55.  
  56. AngleX := AngleX + SpeedX
  57. AngleY := AngleY + SpeedY
  58. SpeedX := SpeedX * (sin AngleX * 0.5 + 0.5)
  59. SpeedY := SpeedY * 0.95
  60. time
  61.  
  62. play V:text, AX:real, AY:real, Pass:integer ->
  63. play V, AX, AY, Pass, 600, 310
  64.  
  65. play V:text, AX:real, AY:real, Pass:integer, Size:real, Depth:real ->
  66. dcos A:real -> cos (A * pi/180)
  67. volume A:real -> 0.5 + 0.5 * dcos A
  68.  
  69. // We do this to draw back pictures before front pictures
  70. if dcos(AngleX+AX) * dcos(AngleY+AY) * Pass > 0 then
  71. locally
  72. rotatey AY
  73. rotatex AX
  74. translatez Depth
  75. locally
  76. color "lightblue", 0.2
  77. line_color "darkgrey", 0.2
  78. line_width 3
  79. rectangle 0, 0, Size, Size
  80. locally
  81. color "white"
  82. if movie_time V > 0 and not movie_playing V then
  83. movie_drop V
  84. movie_texture V
  85. movie_set_volume V, volume (AngleX+AX) * volume(AngleY+AY)
  86. rectangle 0, 0, Size, Size * texture_height / (texture_width+1)
  87. text_box 0, 0, Size, Size,
  88. align_center
  89. vertical_align_bottom
  90. color "white"
  91. font "Ubuntu", 20
  92. text V
  93. line_break
  94. text "Time=" & text movie_time V
  95. text (if movie_playing V then " playing" else " not playing")
  96. text (if movie_done V then " done" else " not done")
  97.  
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement