December 03, 2020, 08:32:38 PM

Author Topic: [bb] 3d Parralaxing by Fuller [ 1+ years ago ]  (Read 570 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] 3d Parralaxing by Fuller [ 1+ years ago ]
« on: June 29, 2017, 12:28:40 AM »
Title : 3d Parralaxing
Author : Fuller
Posted : 1+ years ago

Description : Parraling effect

Step one:
Create a couple planes [CreatePlane()]
Remember to offset one on the Y axis
Step two:
Assign Alpha or masked textures to the planes
The bottom plane should have a bigger texture (ScaleTexture())
Step three:
That's it! Move the camera around the plane to see the effect!

Hope this helps someone
Example (not the cleanest though, you'll need some star image):


Code :
Code: BlitzBasic
  1. Function Make_Parallaxing_Stars_and_Sky()
  2.  
  3. plane=CreatePlane()
  4. MoveEntity plane,0,-1,0
  5.  
  6. p_tex=LoadTexture("mediastars.bmp",2)
  7. ScaleTexture p_tex,20,20
  8. EntityTexture plane,p_tex  
  9.  
  10. plane2=CreatePlane()
  11. MoveEntity plane2,0,-10,0
  12.  
  13.  
  14. p_tex2=LoadTexture("mediastars.bmp",2)
  15. ScaleTexture p_tex2,50,50
  16. EntityTexture plane2,p_tex2  
  17.  
  18. plane3=CreatePlane()
  19. MoveEntity plane3,0,-20,0
  20.  
  21. p_tex3=LoadTexture("mediastars.bmp")
  22. ScaleTexture p_tex3,50,50
  23. EntityTexture plane3,p_tex3
  24.  
  25. ;top planes
  26. plane1=CreatePlane()
  27. MoveEntity plane1,0,20,0
  28. TurnEntity plane1,180,0,0
  29.  
  30.  
  31. p_tex1=LoadTexture("mediastars.bmp",2)
  32. ScaleTexture p_tex1,20,20
  33. EntityTexture plane1,p_tex1
  34.  
  35. plane21=CreatePlane()
  36. MoveEntity plane21,0,30,0
  37. TurnEntity plane21,180,0,0
  38.  
  39. p_tex21=LoadTexture("mediastars.bmp",2)
  40. ScaleTexture p_tex21,50,50
  41. EntityTexture plane21,p_tex21  
  42.  
  43. plane31=CreatePlane()
  44. MoveEntity plane31,0,40,0
  45. TurnEntity plane31,180,0,0
  46.  
  47. p_tex31=LoadTexture("mediastars.bmp")
  48. ScaleTexture p_tex31,50,50
  49. EntityTexture plane31,p_tex31
  50.  
  51. ;sky
  52. sky=CreateSphere(30)
  53. ScaleEntity sky,200,200,200
  54. ScaleTexture p_tex31,.1,.1
  55. EntityTexture sky,p_tex31
  56. FlipMesh sky
  57.  
  58.  
  59. end function


Comments : none...

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal