# JSR 184: void transform( float[] vectors ) question

This topic is 4837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

From my understanding and testing, this func (from the class Transform) does: for each 4-tuple V in vectors V' = T*V where T is the matrix representing this transform But since JSR 184 transforms are row major, vectors are usually transformed like this V' = V*T (1) where T can be any transform ( i.e., modelview matrix) and V is usually a vertex in your mesh and V' is the transformed result ( i.e., vertex in view space ) But with this void transform(float[] vectors) method in jsr184, I must call this.transpose(); then this.transform( myFloatArrayAsVectors ); to achieve the effect of (1) Please clarify the use of this method or my erraneous reasoning Thanks BTW, This is the javadoc for this method --------------------------------- transform public void transform(float[] vectors) Multiplies the given array of 4D vectors with this matrix. The transformation is done in place, that is, the original vectors are overwritten with the transformed vectors. The vectors are given as a flat array of (x y z w) quadruplets. The length of the array divided by 4 gives the number of vectors to transform. Note that this is a simple matrix-by-vector multiplication; no division by W or other operations are implied. The interpretation of the input and output values is up to each application. Parameters: vectors - the vectors to transform, in (xyzw xyzw xyzw ...) order Throws: java.lang.NullPointerException - if points is null java.lang.IllegalArgumentException - if points.length % 4 != 0 ------------------------------------ [Edited by - jeremy_huang on August 18, 2005 3:04:57 PM]

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 9
• 9
• 9
• 14
• 12
• ### Forum Statistics

• Total Topics
633300
• Total Posts
3011267
• ### Who's Online (See full list)

There are no registered users currently online

×