Facebook
From Soft Finch, 1 Week ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 44
  1. -- This is for the rocks
  2.  
  3. myEntities model =  
  4.     [
  5.     group3D (usingTracingtool model)
  6.     ]
  7.  
  8.  
  9. usingTracingtool model =
  10.   List.map
  11.     ( \ (num1,num2) ->
  12.        rock model
  13.         |> move3D (2 * num1, 2 * num2, 0)
  14.     )
  15.     [(-80.14,28.676),(-67.22,41.590),(-44.81,43.869),(-23.16,43.869),(-1.519,38.551),(17.851,29.436),(22.789,8.1661),(20.510,-16.90),(9.8753,-38.93),(-14.05,-46.14),(-37.98,-48.04),(-63.05,-33.99),(-75.20,-10.82),(-66.84,11.204),(-56.97,29.816),(-34.56,30.575),(-9.875,28.296),(8.3560,14.243),(4.9376,-13.48)]
  16.  
  17. rock model = group3D
  18.   [
  19.   ellipsoid 10 20 15 model.meshStore
  20.   |> textured (getColorTexture "rock1" model) (constantTexture 0) (constantTexture 0)
  21.   |> scale3D 0.25
  22.   |> rotateY3D (degrees 90)
  23.   |> move3D (0,0,0)
  24.   ,
  25.   ellipsoid 10 20 15 model.meshStore
  26.   |> textured (getColorTexture "rock2" model) (constantTexture 0) (constantTexture 0)
  27.   |> scale3D 0.5
  28.   |> rotateY3D (degrees 90)
  29.   |> move3D (12,0,0)
  30.   ,
  31.   ellipsoid 10 20 15 model.meshStore
  32.   |> textured (getColorTexture "rock3" model) (constantTexture 0) (constantTexture 0)
  33.   |> scale3D 0.5
  34.   |> rotateY3D (degrees 90)
  35.   |> move3D (0,15,0)
  36.   ,
  37.   ellipsoid 10 20 15 model.meshStore
  38.   |> textured (getColorTexture "rock4" model) (constantTexture 0) (constantTexture 0)
  39.   |> scale3D 0.75
  40.   |> rotateY3D (degrees 90)
  41.   |> move3D (-14,4,0)
  42.   ,
  43.   ellipsoid 10 20 15 model.meshStore
  44.   |> textured (getColorTexture "rock5" model) (constantTexture 0) (constantTexture 0)
  45.   |> scale3D 1
  46.   |> rotateY3D (degrees 90)
  47.   |> move3D (0,-25,0)
  48.   ]
  49.  
  50.  
  51. -- move / edit the light
  52. lightData =
  53.     { position = Point3d.centimeters 0 0 100    -- position of the light
  54.     , chromaticity = Light.sunlight             -- the colour of the light (see https://package.elm-lang.org/packages/ianmackenzie/elm-3d-scene/latest/Scene3d-Light#Chromaticity)
  55.     , intensity = LuminousFlux.lumens 10000     -- how intense the light is
  56.     , castsShadows = True                       -- whether the light will cast shadows
  57.     , showEntity = True                         -- whether the light ball will be rendered (the light itself shines regardless)
  58.     }
  59.  
  60. -- Use "loadTexture [name] [type] [url]" to load in texture images from the Internet!
  61. -- Give each one a unique name, and specify its type (TexColor, TexRoughness, or TexMetallicity).
  62. -- You can list many of them!
  63. myTextures =
  64.     [ loadTexture "rock1" TexColor "https://cdnb.artstation.com/p/assets/images/images/006/158/983/large/peter-larsen-stylizedrockdiffuse.jpg?1496436096"
  65.     ,
  66.       loadTexture "rock2" TexColor "https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/ec2e3a8b-3d93-4892-b684-e90a598fbd17/d2067kh-26404e9f-0cf3-4ee8-abce-6f9ccd914582.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7InBhdGgiOiJcL2ZcL2VjMmUzYThiLTNkOTMtNDg5Mi1iNjg0LWU5MGE1OThmYmQxN1wvZDIwNjdraC0yNjQwNGU5Zi0wY2YzLTRlZTgtYWJjZS02ZjljY2Q5MTQ1ODIuanBnIn1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmZpbGUuZG93bmxvYWQiXX0.FPrvetQywEzTht8wxxjxEkaZoWRwVP1_UKBhKtEbQ9k"
  67.     ,
  68.       loadTexture "rock3" TexColor "https://www.the3rdsequence.com/texturedb/thumbnail/46/512/mountain+rock.jpg"
  69.     ,
  70.       loadTexture "rock4" TexColor "https://www.the3rdsequence.com/texturedb/thumbnail/41/512/red+mountain+rock.jpg"
  71.     ,
  72.       loadTexture "rock5" TexColor "https://static.turbosquid.com/Preview/2016/07/05__03_18_44/CrackedRock1_512.jpgF42AF2B1-6577-4525-9C6C-4E2EE28AC02ELarge.jpg"
  73.     ]
  74.