Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
0efe8b6
Update textureWrap.mdx
ienground Apr 29, 2024
bb8d52c
Update textureWrap.mdx
ienground Apr 29, 2024
1da34fe
Update textureWrap.mdx
ienground Apr 29, 2024
0b9d42e
Update normalMaterial.mdx
ienground Apr 29, 2024
d986fc9
Update normalMaterial.mdx
ienground Apr 29, 2024
6d9ff0a
Update ambientMaterial.mdx
ienground Apr 29, 2024
4d18e70
Update ambientMaterial.mdx
ienground Apr 29, 2024
0276923
Update ambientMaterial.mdx
ienground Apr 29, 2024
8e0efa6
Update emissiveMaterial.mdx
ienground Apr 29, 2024
90716ff
Update emissiveMaterial.mdx
ienground Apr 29, 2024
66a09ad
Update emissiveMaterial.mdx
ienground Apr 29, 2024
c00b09b
Update specularMaterial.mdx
ienground Apr 29, 2024
c3fec78
Update specularMaterial.mdx
ienground Apr 29, 2024
0027dbc
Update shininess.mdx
ienground Apr 29, 2024
db8b01b
Update metalness.mdx
ienground Apr 29, 2024
151941a
Update shader.mdx
ienground Apr 29, 2024
cfb4a43
Update copyToContext.mdx
ienground Apr 29, 2024
1567c96
Update shader.mdx
ienground Apr 29, 2024
b20fc60
Update textureWrap.mdx
ienground Apr 29, 2024
9b6ad33
Update ambientMaterial.mdx
ienground Apr 29, 2024
2ad8fba
Update emissiveMaterial.mdx
ienground Apr 29, 2024
30b08c9
Update specularMaterial.mdx
ienground Apr 29, 2024
e632195
Update shininess.mdx
ienground Apr 29, 2024
3937790
Update metalness.mdx
ienground Apr 29, 2024
3583f28
Update shader.mdx
ienground Apr 29, 2024
f0c2692
Update copyToContext.mdx
ienground Apr 29, 2024
7253936
Update copyToContext.mdx
ienground Apr 29, 2024
3402ce0
Update setUniform.mdx
ienground Apr 29, 2024
bfe6fdb
Update camera.mdx
ienground Apr 29, 2024
403512d
Update camera.mdx
ienground Apr 29, 2024
73a80e2
Update camera.mdx
ienground Apr 29, 2024
25a1f54
Update camera.mdx
ienground Apr 29, 2024
26150cd
Update perspective.mdx
ienground Apr 29, 2024
3aa479e
Update linePerspective.mdx
ienground Apr 29, 2024
471f107
Update ortho.mdx
ienground Apr 29, 2024
a1fd3bb
Update ortho.mdx
ienground Apr 29, 2024
6ad85d1
Update perspective.mdx
ienground Apr 29, 2024
acbef38
Update frustum.mdx
ienground Apr 29, 2024
5009571
Update createCamera.mdx
ienground Apr 29, 2024
ca88256
Update createCamera.mdx
ienground Apr 29, 2024
251d007
Update setCamera.mdx
ienground Apr 29, 2024
93223ae
Update camera.mdx
ienground Apr 29, 2024
88444c4
Update eyeX.mdx
ienground Apr 29, 2024
bcce9e1
Update eyeY.mdx
ienground Apr 29, 2024
6d723c7
Update eyeZ.mdx
ienground Apr 29, 2024
3fe2461
Update centerX.mdx
ienground Apr 29, 2024
1b37518
Update centerY.mdx
ienground Apr 29, 2024
4380e88
Update centerX.mdx
ienground Apr 29, 2024
5281512
Update centerZ.mdx
ienground Apr 29, 2024
0570021
Update upX.mdx
ienground Apr 29, 2024
8c844b2
Update upY.mdx
ienground Apr 29, 2024
a38c86f
Update upZ.mdx
ienground Apr 29, 2024
3f8b129
Update perspective.mdx
ienground Apr 29, 2024
d4926f3
Update camera.mdx
ienground Apr 29, 2024
8a15140
Update eyeX.mdx
ienground Apr 29, 2024
a381639
Update eyeY.mdx
ienground Apr 29, 2024
c4c6cfa
Update eyeZ.mdx
ienground Apr 29, 2024
1ffa78c
Update copyToContext.mdx
ienground Apr 29, 2024
524e8a2
Update upX.mdx
ienground Apr 29, 2024
59c2c1d
Update upY.mdx
ienground Apr 29, 2024
61c2e4b
Update upZ.mdx
ienground Apr 29, 2024
4a7fe74
Update upX.mdx
ienground Apr 29, 2024
bcfb5a5
Update upY.mdx
ienground Apr 29, 2024
9a77ec0
Update perspective.mdx
ienground Apr 29, 2024
cd23936
Update perspective.mdx
ienground Apr 29, 2024
35d4fc0
Update setUniform.mdx
ienground Apr 29, 2024
996a2ce
Update ambientMaterial.mdx
ienground Apr 29, 2024
dd139ff
Update camera.mdx
ienground Apr 29, 2024
6c70ca1
Update linePerspective.mdx
ienground Apr 29, 2024
5d750c6
Update perspective.mdx
ienground Apr 29, 2024
f3ea6ec
Update perspective.mdx
ienground Apr 29, 2024
b63f13b
Update perspective.mdx
ienground Apr 29, 2024
9b38c1f
Update eyeZ.mdx
ienground May 1, 2024
dc1f292
Update setUniform.mdx
ienground May 1, 2024
54790e4
Update emissiveMaterial.mdx
ienground May 1, 2024
af7c704
Update shader.mdx
ienground May 1, 2024
b479e60
Update textureWrap.mdx
ienground May 1, 2024
9b898af
Update textureWrap.mdx
ienground May 1, 2024
9bb069c
Update shader.mdx
ienground May 1, 2024
faeec3d
Update centerX.mdx
ienground May 1, 2024
206df18
Update centerY.mdx
ienground May 1, 2024
3e18eb4
Update centerZ.mdx
ienground May 1, 2024
cef67e2
Update camera.mdx
ienground May 1, 2024
3bdaaff
Update eyeX.mdx
ienground May 1, 2024
4878427
Update eyeY.mdx
ienground May 1, 2024
e048107
Update eyeZ.mdx
ienground May 1, 2024
e5ee23a
Merge branch 'main' into ienground-patch-1
designerSejinOH May 1, 2024
ba45330
Update camera.mdx
ienground May 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update perspective.mdx
  • Loading branch information
ienground authored Apr 29, 2024
commit 26150cd813a2a89f2527dfb42bae86cce864e28a
104 changes: 13 additions & 91 deletions src/content/reference/ko/p5/perspective.mdx
Original file line number Diff line number Diff line change
@@ -1,91 +1,17 @@
---
title: perspective
module: 3D
submodule: Camera
submodule: 카메라
file: src/webgl/p5.Camera.js
description: >
<p>Sets a perspective projection for the current camera in a 3D sketch.</p>

<p>In a perspective projection, shapes that are further from the camera appear

smaller than shapes that are near the camera. This technique, called

foreshortening, creates realistic 3D scenes. It’s applied by default in

WebGL mode.</p>

<p><code>perspective()</code> changes the camera’s perspective by changing its
viewing

frustum. The frustum is the volume of space that’s visible to the camera.

Its shape is a pyramid with its top cut off. The camera is placed where

the top of the pyramid should be and views everything between the frustum’s

top (near) plane and its bottom (far) plane.</p>

<p>The first parameter, <code>fovy</code>, is the camera’s vertical field of
view. It’s

an angle that describes how tall or narrow a view the camera has. For

example, calling <code>perspective(0.5)</code> sets the camera’s vertical
field of

view to 0.5 radians. By default, <code>fovy</code> is calculated based on the
sketch’s

height and the camera’s default z-coordinate, which is 800. The formula for

the default <code>fovy</code> is <code>2 * atan(height / 2 / 800)</code>.</p>

<p>The second parameter, <code>aspect</code>, is the camera’s aspect ratio.
It’s a number

that describes the ratio of the top plane’s width to its height. For

example, calling <code>perspective(0.5, 1.5)</code> sets the camera’s field of
view to

0.5 radians and aspect ratio to 1.5, which would make shapes appear thinner

on a square canvas. By default, aspect is set to <code>width /
height</code>.</p>

<p>The third parameter, <code>near</code>, is the distance from the camera to
the near

plane. For example, calling <code>perspective(0.5, 1.5, 100)</code> sets the
camera’s

field of view to 0.5 radians, its aspect ratio to 1.5, and places the near

plane 100 pixels from the camera. Any shapes drawn less than 100 pixels

from the camera won’t be visible. By default, near is set to <code>0.1 *
800</code>,

which is 1/10th the default distance between the camera and the origin.</p>

<p>The fourth parameter, <code>far</code>, is the distance from the camera to
the far

plane. For example, calling <code>perspective(0.5, 1.5, 100, 10000)</code>
sets the

camera’s field of view to 0.5 radians, its aspect ratio to 1.5, places the

near plane 100 pixels from the camera, and places the far plane 10,000

pixels from the camera. Any shapes drawn more than 10,000 pixels from the

camera won’t be visible. By default, far is set to <code>10 * 800</code>,
which is 10

times the default distance between the camera and the origin.</p>

<p>Note: <code>perspective()</code> can only be used in WebGL mode.</p>
<p>3D 스케치에서 현재 카메라의 원근 투영을 설정합니다.</p>
<p>원근 투영에서, 카메라로부터 멀리 떨어진 도형은 카메라 근처에 있는 도형보다 더 작게 나타납니다. 단축법(foreshortening)이라고 불리는 이 기술은 사실적인 3D 장면을 만들며, WebGL 모드에서 기본적으로 사용됩니다.</p>
<p><code>perspective()</code>는 뷰 절두체(viewing frustum)를 변경함으로써 카메라의 원근법을 변경합니다. 절두체는 카메라가 볼 수 있는 공간의 크기입니다. 이것의 모양은 꼭대기가 잘린 피라미드입니다. 카메라는 피라미드의 꼭대기가 있어야 하는 곳에 위치하고, 절두체의 꼭대기 (근처) 평면과 바닥 (멀리 떨어진) 평면 사이의 모든 것을 담습니다.</p>
<p>첫번째 매개 변수인 <code>fovy</code>는 카메라의 수직 시야입니다. 카메라의 시야가 얼마나 높거나 좁은지를 설명하는 각도입니다. 예를 들어, <code>perspective(0.5)</code>를 호출하면 카메라의 수직 시야가 0.5 라디안으로 설정됩니다. 기본적으로 <code>fovy</code>는 스케치의 높이와 카메라의 기본 z 좌표값인 800을 기반으로 계산됩니다. <code>fovy</code>의 기본값을 계산하는 공식은 <code>2 * atan(height / 2 / 800)</code>입니다.</p>
<p>두번째 매개 변수인 <code>aspect</code>는 카메라의 종횡비입니다. 이것은 맨 위 평면의 가로와 세로의 비율을 설명하는 숫자입니다. 예를 들어, <code>perspective(0.5, 1.5)</code>를 호출하면 카메라의 시야를 0.5 라디안으로 설정하고 종횡비를 1.5로 설정하여 정사각형 캔버스에서 도형을 더 얇아 보이게 합니다. 기본적으로, aspect는 <code>width / height</code>로 설정됩니다.</p>
<p>세번째 매개 변수인 <code>near</code>는 카메라에서 가까운 평면까지의 거리입니다. 예를 들어, <code>perspective(0.5, 1.5, 100)</code>를 호출하면 카메라의 시야를 0.5 라디안으로 설정하고, 종횡비를 1.5로 설정하고, 카메라에서 가까운 평면을 100 픽셀로 배치합니다. 카메라에서 100 픽셀 미만으로 그려진 어떤 모양도 볼 수 없습니다. 기본적으로 near는 카메라와 원점 사이의 기본 거리의 1/0인 <code>0.1 * 800</code>로 설정됩니다.</p>
<p>네번째 매개 변수인 <code>far</code>는 카메라에서 먼 평면까지의 거리입니다. 예를 들어, <code>perspective(0.5, 1.5, 100, 10000)</code>를 호출하면 카메라의 시야를 0.5 라디안으로 설정하고 , 종횡비를 1.5로 설정하고, 카메라에서 가까운 평면을 100 픽셀로 배치하고, 카메라에서 먼 평면을 10,000 픽셀로 배치합니다. 카메라에서 10,000 픽셀 이상 그려진 어떤 모양도 볼 수 없습니다. 기본적으로 far는 카메라와 원점 사이의 기본 거리의 10배인 <code>10 * 800</code>로 설정됩니다.</p>
<p>참고: <code>perspective()</code>는 WebGL 모드에서만 사용할 수 있습니다.</p>
line: 148
isConstructor: false
itemtype: method
Expand Down Expand Up @@ -162,26 +88,22 @@ class: p5
params:
- name: fovy
description: |
<p>camera frustum vertical field of view. Defaults to
<code>2 * atan(height / 2 / 800)</code>.</p>
<p>카메라 절두체 수직 시야. 기본값 <code>2 * atan(height / 2 / 800)</code></p>
type: Number
optional: true
- name: aspect
description: |
<p>camera frustum aspect ratio. Defaults to
<code>width / height</code>.</p>
<p>카메라 절두체 종횡비. 기본값 <code>width / height</code></p>
type: Number
optional: true
- name: near
description: |
<p>distance from the camera to the near clipping plane.
Defaults to <code>0.1 * 800</code>.</p>
<p>카메라에서 가까운 클리핑 평면까지의 거리. 기본값 <code>0.1 * 800</code></p>
type: Number
optional: true
- name: far
description: |
<p>distance from the camera to the far clipping plane.
Defaults to <code>10 * 800</code>.</p>
<p>카메라에서 먼 클리핑 평면까지의 거리. 기본값 <code>10 * 800</code></p>
type: Number
optional: true
chainable: true
Expand Down