Squeak Class Documentation category index | class index  
 
B3DMatrix4x4
  category: Balloon3D-Vectors
  superclass: B3DFloatArray
  subclasses:

I represent a general 4x4 transformation matrix commonly used in computer graphics.

instance methods
  accessing
  alternateRotation
at:at:
at:at:put:
rotation
rotation:
rotation:around:
rotation:aroundX:y:z:
rotationAroundX:
rotationAroundY:
rotationAroundZ:
scaling:
scalingX:y:z:
squaredDistanceFrom:
translation
translation:
translationX:y:z:
trotation

  arithmetic
  +
-

  comparing
  squaredErrorDistanceTo:

  converting
  asMatrix4x4
asQuaternion

  double dispatching
  printOn:
productFromMatrix4x4:
productFromVector3:
productFromVector4:

  element-access
  a11
a11:
a12
a12:
a13
a13:
a14
a14:
a21
a21:
a22
a22:
a23
a23:
a24
a24:
a31
a31:
a32
a32:
a33
a33:
a34
a34:
a41
a41:
a42
a42:
a43
a43:
a44
a44:

  initialize
  setBSplineBase
setBetaSplineBaseBias:tension:
setBezierBase
setCardinalBase
setCatmullBase
setIdentity
setPolylineBase
setScale:
setTranslation:
setZero

  private
  privateTransformMatrix:with:into:

  row-access
  row1
row2
row3

  solving
  inplaceDecomposeLU
inplaceHouseHolderInvert
inplaceHouseHolderTransform:
solve:
solveLU:

  testing
  isIdentity
isZero

  transforming
  composeWith:
composedWithGlobal:
composedWithLocal:
inverseTransformation
localDirToGlobal:
localPointToGlobal:
quickTransformV3ArrayFrom:to:
transposed

class methods
  class initialization
  initialize

  instance creation
  identity
numElements
rotatedBy:around:centeredAt:
withOffset:
withRotation:around:
withScale:
zero

instance methods
  accessing top  
 

alternateRotation

Return the angular rotation around each axis of the matrix


 

at:at:


 

at:at:put:


 

rotation

Return the angular rotation around each axis of the matrix


 

rotation:


 

rotation:around:

set up a rotation matrix around the direction aVector3


 

rotation:aroundX:y:z:

set up a rotation matrix around the direction x/y/z


 

rotationAroundX:


 

rotationAroundY:


 

rotationAroundZ:


 

scaling:


 

scalingX:y:z:


 

squaredDistanceFrom:


 

translation


 

translation:


 

translationX:y:z:


 

trotation

Return the angular rotation around each axis of the matrix


  arithmetic top  
 

+

Optimized for Matrix/Matrix operations


 

-

Optimized for Matrix/Matrix operations


  comparing top  
 

squaredErrorDistanceTo:


  converting top  
 

asMatrix4x4


 

asQuaternion

Convert the matrix to a quaternion


  double dispatching top  
 

printOn:

Print the receiver on aStream


 

productFromMatrix4x4:

Multiply a 4x4 matrix with the receiver.


 

productFromVector3:

Multiply aVector (temporarily converted to 4D) with the receiver


 

productFromVector4:

Multiply aVector with the receiver


  element-access top  
 

a11

Return the element a11


 

a11:

Store the element a11


 

a12

Return the element a12


 

a12:

Store the element a12


 

a13

Return the element a13


 

a13:

Store the element a13


 

a14

Return the element a14


 

a14:

Store the element a14


 

a21

Return the element a21


 

a21:

Store the element a21


 

a22

Return the element a22


 

a22:

Store the element a22


 

a23

Return the element a23


 

a23:

Store the element a23


 

a24

Return the element a24


 

a24:

Store the element a24


 

a31

Return the element a31


 

a31:

Store the element a31


 

a32

Return the element a32


 

a32:

Store the element a32


 

a33

Return the element a33


 

a33:

Store the element a33


 

a34

Return the element a34


 

a34:

Store the element a34


 

a41

Return the element a41


 

a41:

Store the element a41


 

a42

Return the element a42


 

a42:

Store the element a42


 

a43

Return the element a43


 

a43:

Store the element a43


 

a44

Return the element a44


 

a44:

Store the element a44


  initialize top  
 

setBSplineBase

Set the receiver to the BSpline base matrix


 

setBetaSplineBaseBias:tension:

Set the receiver to the betaSpline base matrix
if beta1=1 and beta2=0 then the bSpline base matrix will be returned


 

setBezierBase

Set the receiver to the bezier base matrix


 

setCardinalBase

Set the receiver to the cardinal spline base matrix - just catmull * 2


 

setCatmullBase

Set the receiver to the Catmull-Rom base matrix


 

setIdentity

Set the receiver to the identity matrix


 

setPolylineBase

Set the receiver to the polyline base matrix :)


 

setScale:


 

setTranslation:


 

setZero

Set the receiver to the zero matrix


  private top  
 

privateTransformMatrix:with:into:

Perform a 4x4 matrix multiplication
m2 * m1 = m3
being equal to first transforming points by m2 and then by m1.
Note that m1 may be identical to m3.
NOTE: The primitive implementation does NOT return m3 - and so don't we!


  row-access top  
 

row1

Return row 1


 

row2

Return row 2


 

row3

Return row 3


  solving top  
 

inplaceDecomposeLU

Decompose the receiver in place by using gaussian elimination w/o pivot search


 

inplaceHouseHolderInvert

Solve the linear equation self * aVector = x by using HouseHolder's transformation.
Note: This scheme is numerically better than using gaussian elimination even though it takes
somewhat longer


 

inplaceHouseHolderTransform:

Solve the linear equation self * aVector = x by using HouseHolder's transformation.
Note: This scheme is numerically better than using gaussian elimination even though it takes
somewhat longer


 

solve:


 

solveLU:

Given a decomposed matrix using gaussian elimination solve the linear equations.


  testing top  
 

isIdentity


 

isZero


  transforming top  
 

composeWith:

Perform a 4x4 matrix multiplication.


 

composedWithGlobal:


 

composedWithLocal:


 

inverseTransformation

Return the inverse matrix of the receiver.


 

localDirToGlobal:

Multiply direction vector with the receiver


 

localPointToGlobal:

Multiply aVector (temporarily converted to 4D) with the receiver


 

quickTransformV3ArrayFrom:to:

Transform the 3 element vertices from srcArray to dstArray.
ASSUMPTION: a41 = a42 = a43 = 0.0 and a44 = 1.0


 

transposed

Return a transposed copy of the receiver


class methods
  class initialization top  
 

initialize

B3DMatrix4x4 initialize


  instance creation top  
 

identity


 

numElements


 

rotatedBy:around:centeredAt:

Create a matrix rotating points around the given origin using the angle/axis pair


 

withOffset:


 

withRotation:around:


 

withScale:


 

zero