Three 圆柱坐标(Cylindrical)和 视锥体(Frustum)

圆柱坐标(Cylindrical)

圆柱坐标:一个点的cylindrical coordinates。英语:cylindrical coordinate system)是一种三维坐标系统。它是二维极坐标系往 z-轴的延伸。添加的第三个坐标 𝑧 专门用来表示 P 点离 xy-平面的高低。按照国际标准化组织建立的约定 (ISO 31-11) ,径向距离、方位角、高度,分别标记为 (𝜌 , 𝜙, 𝑧)。

一般使用(radius,theta,height)来表示点位坐标,三个值可以根据实际使用情况做互换

平面直角坐标系,一般以 (x,y) 两个数值来表示点位坐标
极坐标系,一般以(radius,theta),半径和旋转角度来表示点位坐标

极坐标系和平面直角坐标系可以互相转换:

	//平面直角坐标系转极坐标系
	let radius = Math.sqrt( x * x + y * y );
	let theta = Math.atan( y / x );

	//极坐标系转平面直角坐标系
	let x = radius * Math.cos(theta);
	let y = radius * Math.sin(theta);

构造器(Constructor)

Cylindrical( radius : Float, theta : Float, y : Float )

radius - 从原点到x-z平面上一点的距离 默认值为 1.0.
theta - 在x-z平面内的逆时针角度,以z轴正方向的计算弧度。默认值为0。
y - x-z平面以上的高度 默认值为 0.

属性(Properties)

# .radius : Float

radius - 从原点到x-z平面上一点的距离 默认值为 1.0.

# .theta : Float

theta - 在x-z平面内的逆时针角度,以z轴正方向的计算弧度。默认值为0。

# .y : Float

y - x-z平面以上的高度 默认值为 0.

Methods

# .clone () : Cylindrical

返回一个与当前拥有相同 radius, theta 和 y 属性的圆柱坐标。

# .copy ( other : Cylindrical ) : Cylindrical

将传入的圆柱坐标对象的 radius, theta 和 y 属性赋给当前对象。

# .set ( radius : Float, theta : Float, y : Float ) : Cylindrical

设置该对象的 radius, theta 和 y 属性。

# .setFromVector3 ( vec3 : Vector3 ) : Cylindrical

从 Vector3 中取x,y,z,并调用setFromCartesianCoords来设置圆柱坐标的 radius、theta 和 y 的属性值。

# .setFromCartesianCoords ( x : Float, y : Float, z : Float ) : Cylindrical

使用笛卡尔坐标来设置该圆柱坐标中 radius, theta 以及 y 的属性值。

视锥体(Frustum)

Frustums 用于确定相机视野内的东西。 它有助于加速渲染过程——位于摄像机视锥体外的物体可以安全地排除在渲染之外。

该类主要用于渲染器内部计算 camera 或 shadowCamera的视锥体。

构造器(Constructor)

Frustum(p0 : Plane, p1 : Plane, p2 : Plane, p3 : Plane, p4 : Plane, p5 : Plane)

p0 - (可选参数) Plane.
p1 - (可选参数) Plane.
p2 - (可选参数) Plane.
p3 - (可选参数) Plane.
p4 - (可选参数) Plane.
p5 - (可选参数) Plane.

使用6个面来构建一个视锥体。

属性(Properties)

# .planes : Array

包含6个平面 planes 的数组。

方法(Methods)

# .clone () : Frustum

返回一个与当前对象有相同参数的视锥体。

# .containsPoint ( point : Vector3 ) : Boolean

point - Vector3 to test.

检测该点 point 是否在视锥体内。

# .copy ( frustum : Frustum ) : Frustum

frustum - 用于拷贝的视锥体。

将传入 frustum 的属性拷贝到当前对象。

# .intersectsBox ( box : Box3 ) : Boolean

box - Box3 用于检测是否要交的包围盒。

返回 true 如果该 box 与视锥体相交。

# .intersectsObject ( object : Object3D ) : Boolean

检测 object 的包围球 bounding sphere 是否与视锥体相交。

注意:该对象必须有一个 Geometry 或 BufferGeometry ,因为这样才能计算出包围球。

# .intersectsSphere ( sphere : Sphere ) : Boolean

sphere - Sphere 用于检查是否相交。

返回true 如果球sphere与视锥体相交。

# .intersectsSprite ( sprite : Sprite ) : Boolean

检查精灵sprite是否与截锥体相交。

# .set ( p0 : Plane, p1 : Plane, p2 : Plane, p3 : Plane, p4 : Plane, p5 : Plane ) : Frustum

使用传入的平面设置当前视锥体。没有隐式的顺序。

# .setFromMatrix ( matrix : Matrix4 ) : Frustum

matrix - Matrix4 用于设置 planes

WebGLRenderer 使用 Camera的投影矩阵(projectionMatrix ) 和相机世界变换矩阵的逆矩阵 matrixWorldInverse 来设置视锥体。

相关推荐

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 09:36:03       66 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 09:36:03       70 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 09:36:03       57 阅读
  4. Python语言-面向对象

    2024-07-12 09:36:03       68 阅读

热门阅读

  1. Emacs有什么优点,用Emacs写程序比IDE更方便吗?

    2024-07-12 09:36:03       28 阅读
  2. 从C向C++18——演讲比赛流程管理系统

    2024-07-12 09:36:03       20 阅读
  3. Android11 MTK 状态栏添加无Sim卡图标

    2024-07-12 09:36:03       29 阅读
  4. springboot+vue项目实战2024第四集修改文章信息

    2024-07-12 09:36:03       27 阅读
  5. c#验证输入语句是否带有sql入侵的方法

    2024-07-12 09:36:03       27 阅读
  6. 【LinuxC语言】手撕Http协议之GET方法的实现

    2024-07-12 09:36:03       24 阅读
  7. 云端荣耀:在iCloud中记录您的个人成就与荣誉

    2024-07-12 09:36:03       29 阅读
  8. Postman接口测试工具详解

    2024-07-12 09:36:03       26 阅读
  9. GESP C++ 三级真题(2024年3月)T2 完全平方数

    2024-07-12 09:36:03       22 阅读
  10. 【排序 - 选择排序优化版(利用堆排序)】

    2024-07-12 09:36:03       22 阅读
  11. 【贪心算法题记录】134. 加油站

    2024-07-12 09:36:03       24 阅读
  12. 超级源点/汇点(算法篇)

    2024-07-12 09:36:03       30 阅读