lixyz
V2EX  ›  Android

Android,随机分布相关

  •  
  •   lixyz · Oct 12, 2020 · 11981 views
    This topic created in 2063 days ago, the information mentioned may be changed or developed.

    我想实现如下功能

    在背景中,实现雨点下落的效果

    雨大,雨点就密集

    雨小,雨点就稀疏

    该如何确定雨点的位置啊

    完全懵逼

    3 replies    2020-10-14 00:37:34 +08:00
    hongch
        1
    hongch  
       Oct 13, 2020
    用 canvas 自己画不就能知道每个雨点的位置了?
    lixyz
        2
    lixyz  
    OP
       Oct 13, 2020
    @hongch 就是使用 canvas 来画啊,但是我想要那种看起来是雨点是自然分布,而不是生硬的均分
    codehz
        3
    codehz  
       Oct 14, 2020 via Android
    https://zh.cppreference.com/w/cpp/named_req/RandomNumberDistribution
    参考这个找一个合适的分布就好了)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2895 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 05:45 · PVG 13:45 · LAX 22:45 · JFK 01:45
    ♥ Do have faith in what you're doing.