The Gamegrammer | 게임하는 프로그래머

닫기 검색결과 전체 보기

    유니티(Unity) | Random Point Inside Circle

    Programming/Unity 2017. 10. 8. 13:38



    1
    2
    3
    4
    5
    6
    7
    8
    9
    public Vector3 RandomPointInsideCircle(float radius)
    {
        float u     = Random.Range(0f, 1f);
        float theta = u * (Mathf.PI * 2f);
        float sqrt  = Mathf.Sqrt(Random.Range(0f, 1f));
        radius *= sqrt;
     
        return new Vector3(radius * Mathf.Cos(theta), radius * Mathf.Sin(theta), 0f);
    }
    Colored by Color Scripter
    cs


    저작자표시 비영리 변경금지
    'Programming/Unity' 관련 글 more
    • thumbnail
      유니티(Unity) | Random Point Inside Sphere 2017.10.08
    • thumbnail
      유니티(Unity) | Random Point On Circle 2017.10.08
    • thumbnail
      유니티(Unity) | 유니티 에디터 DX12로 구동하기 2017.10.07
    • thumbnail
      유니티(Unity) | 메쉬(Mesh) 코드로 만들기 2017.10.06
    Posted by Muramasa
블로그 이미지

by Muramasa

    최근...

  • 포스트
  • 댓글
  • 더 보기

태그

  • 랜덤
  • unity
  • 계산기
  • sphere
  • 시야각
  • c++
  • 2d
  • FieldOfView
  • random
  • Circle
  • 유니티
  • 에디터
  • 메쉬
  • Mesh

카운터

Total
Today
Yesterday

공지사항

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록
Muramasa's Blog is powered by daumkakao
Skin info material T Mark 5+ by 뭐하라
favicon

The Gamegrammer | 게임하는 프로그래머

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

관리자 메뉴

  • 관리자 모드
  • 글쓰기
  • 분류 전체보기 (16)
    • 비공개 포스팅 (0)
    • Programming (16)
      • Unity (7)
      • Unreal (0)
      • C++ (9)

카테고리

PC화면 보기 티스토리 Daum

티스토리툴바