用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隐藏过滤条件
flash.geom 

Vector3D  - AS3

x

顶级
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

语言元素

全局常量
全局函数
运算符
语句、关键字和指令
特殊类型

附录

新增内容
编译器错误
编译器警告
运行时错误
迁移到 ActionScript 3
支持的字符集
仅适用于 MXML 的标签
Motion XML 元素
Timed Text 标记
不推荐使用的元素的列表
AccessibilityImplementation 常量
如何使用 ActionScript 示例
法律声明
flash.geom
public class Vector3D
继承Vector3D Inheritance Object

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

Vector3D 类使用笛卡尔坐标 x、y 和 z 表示三维空间中的点或位置。与在二维空间中一样,x 属性表示水平轴,y 属性表示垂直轴。在三维空间中,z 属性表示深度。当对象向右移动时,x 属性的值会增大。当对象向下移动时,y 属性的值会增大。当对象远离视点时,z 属性的值会增大。若使用透视投影和缩放,则对象在靠近屏幕时会显得大一些,而在远离屏幕时会显得小一些。正如右手三维坐标系中一样,正向 z 轴指向远离查看者的方向,并且当对象远离查看者的视线时,z 属性的值增大。全局空间的原点 (0,0,0) 位于舞台的左上角。

X、Y、Z 轴

Vector3D 类还可以表示方向,即一个从坐标原点(例如 (0,0,0))指向一个端点的箭头;或表示 RGB(红、绿、蓝)颜色模型的一个浮点组件。

四元数表示法引入了第四个元素(w 属性),该元素提供额外的方向信息。例如,w 属性可以定义 Vector3D 对象的旋转角度。旋转角度和坐标 x、y 和 z 的组合可确定显示对象的方向。以下是 Vector3D 元素在矩阵表示法中的表示形式:

Vector3D 元素

相关 API 元素



公共属性
 属性由以下参数定义
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  length : Number
[只读] 当前 Vector3D 对象的长度(大小),即从原点 (0,0,0) 到该对象的 x、y 和 z 坐标的距离。
Vector3D
  lengthSquared : Number
[只读] 当前 Vector3D 对象长度的平方,它是使用 x、y 和 z 属性计算出来的。
Vector3D
  w : Number
Vector3D 对象的第四个元素(除了 x、y 和 z 属性之外)可以容纳数据,例如旋转角度。
Vector3D
  x : Number
Vector3D 对象中的第一个元素,例如,三维空间中某个点的 x 坐标。
Vector3D
  y : Number
Vector3D 对象中的第二个元素,例如,三维空间中某个点的 y 坐标。
Vector3D
  z : Number
Vector3D 对象中的第三个元素,例如,三维空间中某个点的 z 坐标。
Vector3D
公共方法
 方法由以下参数定义
  
Vector3D(x:Number = 0., y:Number = 0., z:Number = 0., w:Number = 0.)
创建 Vector3D 对象的实例。
Vector3D
  
将当前 Vector3D 对象的 x、y 和 z 元素的值与另一个 Vector3D 对象的 x、y 和 z 元素的值相加。
Vector3D
  
[静态] 返回两个矢量之间的弧度的角度。
Vector3D
  
返回一个新 Vector3D 对象,它是与当前 Vector3D 对象完全相同的副本。
Vector3D
  
copyFrom(sourceVector3D:Vector3D):void
将源 Vector3D 对象中的所有矢量数据复制到调用方 Vector3D 对象中。
Vector3D
  
返回一个新的 Vector3D 对象,它与当前 Vector3D 对象和另一个 Vector3D 对象垂直(成直角)。
Vector3D
  
按照指定的 Vector3D 对象的 x、y 和 z 元素的值递减当前 Vector3D 对象的 x、y 和 z 元素的值。
Vector3D
  
[静态] 返回两个 Vector3D 对象之间的距离。
Vector3D
  
如果当前 Vector3D 对象和作为参数指定的 Vector3D 对象均为单位顶点,此方法将返回这两个顶点之间所成角的余弦值。
Vector3D
  
equals(toCompare:Vector3D, allFour:Boolean = false):Boolean
通过将当前 Vector3D 对象的 x、y 和 z 元素与指定的 Vector3D 对象的 x、y 和 z 元素进行比较,确定这两个对象是否相等。
Vector3D
 Inherited
表示对象是否已经定义了指定的属性。
Object
  
按照指定的 Vector3D 对象的 x、y 和 z 元素的值递增当前 Vector3D 对象的 x、y 和 z 元素的值。
Vector3D
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
  
nearEquals(toCompare:Vector3D, tolerance:Number, allFour:Boolean = false):Boolean
将当前 Vector3D 对象的元素与指定的 Vector3D 对象的元素进行比较,以确定它们是否大致相同。
Vector3D
  
将当前 Vector3D 对象设置为其逆对象。
Vector3D
  
通过将最前面的三个元素(x、y、z)除以矢量的长度可将 Vector3D 对象转换为单位矢量。
Vector3D
  
将当前 Vector3D 对象的 x、y 和 z 属性的值除以其 w 属性的值。
Vector3D
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
  
按标量(大小)缩放当前的 Vector3D 对象。
Vector3D
 Inherited
设置循环操作动态属性的可用性。
Object
  
将 Vector3D 的成员设置为指定值
Vector3D
  
从另一个 Vector3D 对象的 x、y 和 z 元素的值中减去当前 Vector3D 对象的 x、y 和 z 元素的值。
Vector3D
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
  
返回当前 Vector3D 对象的字符串表示形式。
Vector3D
 Inherited
返回指定对象的原始值。
Object
公共常量
 常量由以下参数定义
  X_AXIS : Vector3D
[静态] 定义为 Vector3D 对象的 x 轴,坐标为 (1,0,0)。
Vector3D
  Y_AXIS : Vector3D
[静态] 定义为 Vector3D 对象的 y 轴,坐标为 (0,1,0)。
Vector3D
  Z_AXIS : Vector3D
[静态] 定义为 Vector3D 对象的 z 轴,坐标为 (0,0,1)。
Vector3D
属性详细信息

length

属性
length:Number  [只读]

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

当前 Vector3D 对象的长度(大小),即从原点 (0,0,0) 到该对象的 x、y 和 z 坐标的距离。w 属性将被忽略。单位矢量具有的长度或大小为一。



实现
    public function get length():Number

相关 API 元素

lengthSquared

属性 
lengthSquared:Number  [只读]

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

当前 Vector3D 对象长度的平方,它是使用 xyz 属性计算出来的。w 属性将被忽略。尽可能使用 lengthSquared() 方法,而不要使用 Vector3D.length() 方法的 Math.sqrt() 方法调用,后者速度较慢。



实现
    public function get lengthSquared():Number

相关 API 元素

w

属性 
public var w:Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

Vector3D 对象的第四个元素(除了 xyz 属性之外)可以容纳数据,例如旋转角度。默认值为 0。

四元数表示法在三维旋转计算中,会将角度用作第四个元素。w 属性可用于定义有关 Vector3D 对象的旋转角度。旋转角度和坐标(x、y、z)的组合可确定显示对象的方向。

此外,可以将 w 属性用作投影的三维位置的透视变形因子,或用作表示投影到二维空间中的三维坐标的投影转换值。例如,可以使用 Matrix3D.rawData 属性创建一个投影矩阵,在将此矩阵应用于 Vector3D 对象时,该对象的第四个元素(w 属性)中会生成一个转换值。然后,将该 Vector3D 对象的其他元素除以此转换值可生成一个投影的 Vector3D 对象。可以使用 Vector3D.project() 方法将 Vector3D 对象的前三个元素除以它的第四个元素。

相关 API 元素

x

属性 
public var x:Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

Vector3D 对象中的第一个元素,例如,三维空间中某个点的 x 坐标。默认值为 0。

y

属性 
public var y:Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

Vector3D 对象中的第二个元素,例如,三维空间中某个点的 y 坐标。默认值为 0。

z

属性 
public var z:Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

Vector3D 对象中的第三个元素,例如,三维空间中某个点的 z 坐标。默认值为 0。

构造函数详细信息

Vector3D

()构造函数
public function Vector3D(x:Number = 0., y:Number = 0., z:Number = 0., w:Number = 0.)

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

创建 Vector3D 对象的实例。如果未指定构造函数的参数,则将使用元素 (0,0,0,0) 创建 Vector3D 对象。

参数
x:Number (default = 0.) — 第一个元素,例如 x 坐标。
 
y:Number (default = 0.) — 第二个元素,例如 y 坐标。
 
z:Number (default = 0.) — 第三个元素,例如 z 坐标。
 
w:Number (default = 0.) — 表示额外数据的可选元素,例如旋转角度。
方法详细信息

add

()方法
public function add(a:Vector3D):Vector3D

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

将当前 Vector3D 对象的 x、y 和 z 元素的值与另一个 Vector3D 对象的 x、y 和 z 元素的值相加。add() 方法不更改当前的 Vector3D 对象。相反,此方法将返回具有新值的新 Vector3D 对象。

将两个矢量相加即可获得一个合成矢量。一种用于可视化结果的方法是,从第一个矢量的原点或尾部到第二个矢量的结束点或开头绘制一个矢量。合成矢量是第一个矢量的原点与第二个矢量的结束点之间的距离。

合成 Vector3D

参数

a:Vector3D — 要与当前 Vector3D 对象相加的 Vector3D 对象。

返回
Vector3D — 一个 Vector3D 对象,它是将当前 Vector3D 对象与另一个 Vector3D 对象相加所产生的结果。

相关 API 元素

angleBetween

()方法 
public static function angleBetween(a:Vector3D, b:Vector3D):Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

返回两个矢量之间的弧度的角度。返回的角度是第一个 Vector3D 对象旋转到与第二个 Vector3D 对象对齐的位置时所形成的最小弧度。

angleBetween() 方法是静态方法。可以将此方法直接用作 Vector3D 类的方法。

要将一个角度转换成弧度,可以使用以下公式:

radian = Math.PI/180 * degree

参数

a:Vector3D — 第一个 Vector3D 对象。
 
b:Vector3D — 第二个 Vector3D 对象。

返回
Number — 两个 Vector3D 对象之间的角度。

clone

()方法 
public function clone():Vector3D

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

返回一个新 Vector3D 对象,它是与当前 Vector3D 对象完全相同的副本。

返回
Vector3D — 一个新 Vector3D 对象,它是当前 Vector3D 对象的副本。

copyFrom

()方法 
public function copyFrom(sourceVector3D:Vector3D):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 11, AIR 3.0, Flash Lite 4

将源 Vector3D 对象中的所有矢量数据复制到调用方 Vector3D 对象中。

参数

sourceVector3D:Vector3D — 要从中复制数据的 Vector3D 对象。

crossProduct

()方法 
public function crossProduct(a:Vector3D):Vector3D

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

返回一个新的 Vector3D 对象,它与当前 Vector3D 对象和另一个 Vector3D 对象垂直(成直角)。如果返回的 Vector3D 对象的坐标为 (0,0,0),则表示两个 Vector3D 对象互相平行。

叉积

可以将多边形表面的两个顶点的标准化叉积与摄像头或眼睛视点的标准化矢量结合使用来获取点积。点积的值可以确定是否从视点中隐藏三维对象的某个表面。

参数

a:Vector3D — 第二个 Vector3D 对象。

返回
Vector3D — 一个新的 Vector3D 对象,它与当前 Vector3D 对象和作为参数指定的 Vector3D 对象垂直。

相关 API 元素

decrementBy

()方法 
public function decrementBy(a:Vector3D):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

按照指定的 Vector3D 对象的 x、y 和 z 元素的值递减当前 Vector3D 对象的 x、y 和 z 元素的值。与 Vector3D.subtract() 方法不同,decrementBy() 方法会更改当前的 Vector3D 对象并且不返回新的 Vector3D 对象。

参数

a:Vector3D — 包含要从当前 Vector3D 对象中减去的值的 Vector3D 对象。

相关 API 元素

distance

()方法 
public static function distance(pt1:Vector3D, pt2:Vector3D):Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

返回两个 Vector3D 对象之间的距离。distance() 方法是静态方法。可以将此方法直接用作 Vector3D 类的方法,以获取两个三维点之间的欧几里德距离。

参数

pt1:Vector3D — 用作第一个三维点的 Vector3D 对象。
 
pt2:Vector3D — 用作第二个三维点的 Vector3D 对象。

返回
Number — 两个 Vector3D 对象之间的距离。

dotProduct

()方法 
public function dotProduct(a:Vector3D):Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

如果当前 Vector3D 对象和作为参数指定的 Vector3D 对象均为单位顶点,此方法将返回这两个顶点之间所成角的余弦值。单位顶点是指向同一方向且长度为一的顶点。它们会在结果中将矢量长度作为一个因子删除。可以使用 normalize() 方法将一个矢量转换为单位矢量。

dotProduct() 方法会找出两个顶点之间所成的角。它还用于背面剔除或照明计算。背面剔除是一个用于确定从视点中隐藏哪些表面的过程。可以使用摄像头或眼睛视点的标准化顶点和多边形表面的顶点的叉积来获取点积。如果点积小于零,则表面将面向摄像头或查看者。如果两个单位顶点互相垂直,则二者正交且点积为零。如果两个单位顶点互相平行,则点积为一。

参数

a:Vector3D — 第二个 Vector3D 对象。

返回
Number — 一个标量,它是当前 Vector3D 对象与指定的 Vector3D 对象之间的点积。

相关 API 元素

equals

()方法 
public function equals(toCompare:Vector3D, allFour:Boolean = false):Boolean

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

通过将当前 Vector3D 对象的 x、y 和 z 元素与指定的 Vector3D 对象的 x、y 和 z 元素进行比较,确定这两个对象是否相等。如果这些元素的值相同,则两个 Vector3D 对象相等。如果第二个可选参数设置为 true,则将对 Vector3D 对象的所有四个元素(包括 w 属性)进行比较。

参数

toCompare:Vector3D — 要与当前 Vector3D 对象进行比较的 Vector3D 对象。
 
allFour:Boolean (default = false) — 一个可选参数,它指定在比较时是否使用 Vector3D 对象的 w 属性。

返回
Boolean — 如果指定的 Vector3D 对象与当前 Vector3D 对象相等,则为 true 值;否则为 false

相关 API 元素

incrementBy

()方法 
public function incrementBy(a:Vector3D):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

按照指定的 Vector3D 对象的 x、y 和 z 元素的值递增当前 Vector3D 对象的 x、y 和 z 元素的值。与 Vector3D.add() 方法不同,incrementBy() 方法会更改当前的 Vector3D 对象并且不返回新的 Vector3D 对象。

参数

a:Vector3D — 要与当前的 Vector3D 对象相加的 Vector3D 对象。

相关 API 元素

nearEquals

()方法 
public function nearEquals(toCompare:Vector3D, tolerance:Number, allFour:Boolean = false):Boolean

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

将当前 Vector3D 对象的元素与指定的 Vector3D 对象的元素进行比较,以确定它们是否大致相同。如果两个顶点的所有元素的值都相等或比较的结果在容差范围内,则两个 Vector3D 对象大致相等。两个元素的值之差必须小于作为 tolerance 参数指定的数字。如果第三个可选参数设置为 true,则将对 Vector3D 对象的所有四个元素(包括 w 属性)进行比较。否则,比较中仅包含 x、y 和 z 元素。

参数

toCompare:Vector3D — 要与当前 Vector3D 对象进行比较的 Vector3D 对象。
 
tolerance:Number — 一个用于确定容差因子的数字。如果 toCompare 参数中指定的 Vector3D 元素的值与当前 Vector3D 元素的值之差小于容差数,则将这两个值视为大致相等。
 
allFour:Boolean (default = false) — 一个可选参数,它指定在比较时是否使用 Vector3D 对象的 w 属性。

返回
Boolean — 如果指定的 Vector3D 对象与当前 Vector3D 对象相等,则为 true 值;否则为 false

相关 API 元素

negate

()方法 
public function negate():void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

将当前 Vector3D 对象设置为其逆对象。也可以将逆对象视为与原始对象相反的对象。当前 Vector3D 对象的 xyz 属性的值将更改为 -x-y-z

normalize

()方法 
public function normalize():Number

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

通过将最前面的三个元素(x、y、z)除以矢量的长度可将 Vector3D 对象转换为单位矢量。单位顶点是具有同一方向且长度为一的顶点。它们通过将长度作为一个因子删除,从而简化了矢量计算。

返回
Number — 当前 Vector3D 对象的长度。

project

()方法 
public function project():void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

将当前 Vector3D 对象的 xyz 属性的值除以其 w 属性的值。

如果当前 Vector3D 对象是将一个 Vector3D 对象与一个投影 Matrix3D 对象相乘后获得的结果,则 w 属性可以容纳转换值。然后,project() 方法可以通过将这些元素除以 w 属性来完成投影。使用 Matrix3D.rawData 属性可创建投影 Matrix3D 对象。

scaleBy

()方法 
public function scaleBy(s:Number):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

按标量(大小)缩放当前的 Vector3D 对象。Vector3D 对象的 x、y 和 z 元素乘以参数中指定的标量数字。例如,如果将矢量放大 10 倍,则得到的矢量的长度比原来的矢量大 10 倍。标量还可以更改矢量的方向。若将矢量乘以一个负数,则将反转该矢量的方向。

参数

s:Number — 一个用于缩放 Vector3D 对象的乘数(标量)。

setTo

()方法 
public function setTo(xa:Number, ya:Number, za:Number):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 11, AIR 3.0, Flash Lite 4

将 Vector3D 的成员设置为指定值

参数

xa:Number — 要将 Vector 设置为的值。
 
ya:Number
 
za:Number

subtract

()方法 
public function subtract(a:Vector3D):Vector3D

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

从另一个 Vector3D 对象的 x、y 和 z 元素的值中减去当前 Vector3D 对象的 x、y 和 z 元素的值。subtract() 方法不更改当前的 Vector3D 对象。相反,此方法将返回一个具有新值的新的 Vector3D 对象。

参数

a:Vector3D — 要从当前 Vector3D 对象中减去的 Vector3D 对象。

返回
Vector3D — 一个新的 Vector3D 对象,它是当前 Vector3D 对象与指定的 Vector3D 对象之差。

相关 API 元素

toString

()方法 
public function toString():String

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

返回当前 Vector3D 对象的字符串表示形式。该字符串包含 xyz 属性的值。

返回
String — 一个字符串,它包含 xyz 属性的值。
常量详细信息

X_AXIS

常量
public static const X_AXIS:Vector3D

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

定义为 Vector3D 对象的 x 轴,坐标为 (1,0,0)。

Y_AXIS

常量 
public static const Y_AXIS:Vector3D

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

定义为 Vector3D 对象的 y 轴,坐标为 (0,1,0)。

Z_AXIS

常量 
public static const Z_AXIS:Vector3D

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

定义为 Vector3D 对象的 z 轴,坐标为 (0,0,1)。





[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。