student-ar-org-papervision3d-core-math-Number3D.ax [swf] [flash] flex
* The @ax-student-ar-org-papervision3d-core-math-Number3D class represents a value in a three-dimensional coordinate system. * * Properties x, y and z represent the horizontal, vertical and z the depth axes respectively. *
* The horizontal coordinate value.
* The vertical coordinate value.
* The depth coordinate value.
* pre-made @ax-student-ar-org-papervision3d-core-math-Number3D : used by various methods as a way to temporarily store @files.
* Creates a new @ax-student-ar-org-papervision3d-core-math-Number3D object whose three-dimensional values are specified by the x, y and z parameters. If you call this constructor function without parameters, a @ax-student-ar-org-papervision3d-core-math-Number3D with x, y and z properties set to zero is created. * * @param x The horizontal coordinate value. The default value is zero. * @param y The vertical coordinate value. The default value is zero. * @param z The depth coordinate value. The default value is zero.
* Returns a new @ax-student-ar-org-papervision3d-core-math-Number3D object that is a clone of the original instance with the same three-dimensional values. * * @return A new @ax-student-ar-org-papervision3d-core-math-Number3D instance with the same three-dimensional values as the original @ax-student-ar-org-papervision3d-core-math-Number3D instance.
* Copies the values of this Number3d to the passed Number3d. *
* Copies the values of this Number3d to the passed Number3d. *
* Quick way to set the properties of the @ax-student-ar-org-papervision3d-core-math-Number3D *
* Modulo
* Add
* Subtract.
* Dot product.
* Cross product. Now optionally takes a target @ax-student-ar-org-papervision3d-core-math-Number3D to put the change into. So we're not constantly making new number3Ds. * Maybe make a crossEq function?
* Normalize.
* Multiplies the vector by a number. The same as the *= operator
* Adds the vector passed to this vector. The same as the += operator.
* Subtracts the vector passed to this vector. The same as the -= operator.
* Super fast modulo(length, magnitude) comparisons. * *
* Returns a @ax-student-ar-org-papervision3d-core-math-Number3D object with x, y and z properties set to zero. * *
returns: A @ax-student-ar-org-papervision3d-core-math-Number3D object. */ static public function get ZERO():@ax-student-ar-org-papervision3d-core-math-Number3D { return new @ax-student-ar-org-papervision3d-core-math-Number3D( 0, 0, 0 ); } /** * Returns a string value representing the three-dimensional values in the specified @ax-student-ar-org-papervision3d-core-math-Number3D object. * * @return A string. */ public function toString(): String { return 'x:' + Math.round(x*100)/100 + ' y:' + Math.round(y*100)/100 + ' z:' + Math.round(z*100)/100; } //------- TRIG FUNCTIONS /** * * * */ public function rotateX(angle:Number) :void { if(Papervision3D.useDEGREES) angle*= toRADIANS; var cosRY:Number = Math.cos(angle); var sinRY:Number = Math.sin(angle); temp.copyFrom(this); this.y = (temp.y*cosRY)-(temp.z*sinRY); this.z = (temp.y*sinRY)+(temp.z*cosRY); } public function rotateY(angle:Number) :void { if(Papervision3D.useDEGREES) angle*= toRADIANS; var cosRY:Number = Math.cos(angle); var sinRY:Number = Math.sin(angle); temp.copyFrom(this); this.x= (temp.x*cosRY)+(temp.z*sinRY); this.z= (temp.x*-sinRY)+(temp.z*cosRY); } public function rotateZ(angle:Number) :void { if(Papervision3D.useDEGREES) angle*= toRADIANS; var cosRY:Number = Math.cos(angle); var sinRY:Number = Math.sin(angle); temp.copyFrom(this); //this.x= temp.x; this.x= (temp.x*cosRY)-(temp.y*sinRY); this.y= (temp.x*sinRY)+(temp.y*cosRY); } }}
[]readme course(s) prefaceI 1 2II 3 4III 5 6 7IV 8 9 10V 11 12 afterthought(s)appendix reference(s) example(s)resource(s) _![]()
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.