Jump to content
Site Stability Read more... ×
  • Advertisement
Sign in to follow this  

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

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

If you intended to correct an error in the post then please contact us.

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]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!