lixyz
V2EX  ›  Android

Android,随机分布相关

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

    我想实现如下功能

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

    雨大,雨点就密集

    雨小,雨点就稀疏

    该如何确定雨点的位置啊

    完全懵逼

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