1

I understand the 'xyz' components of a vertex's position, but what does 'w' do? Could it be left as the same constant value all the time?

Example:

mov op.xyz, va0.xyz
mov op.w vc0.w
J. Holmes
  • 18,466
  • 5
  • 47
  • 52
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
  • From what I have read, the "w" value is often used in practice for rendering lighting effects. From the docs on Vector3D class: "The fourth element of a Vector3D object (in addition to the x, y, and z properties) can hold data such as the angle of rotation." I know this is a terrible answer. – jpwrunyan Apr 11 '12 at 08:41
  • Haha, well it was a good try @jpwrunyan. It seems to be more than just a data storage field though. I'm pretty sure I've played with it in the past and it changes the **scale** of a model. I may have been modifying other values though and got the wrong impression :S. Thanks for sharing what you found in the docs though :) – chamberlainpi Apr 11 '12 at 12:59
  • Yeah, I actually started to write a reply talking about that but realized I still don't understand the math. Then I changed my answer to simply "You need 'w' so that you can perform the matrix math necessary for rotation and position (ie 1x4 matrix for valid multiplication with 4x4)" but then decided that if someone posted an answer like that to me, I would punch them in the mouth... but yeah, it's for rotation. I can't explain any better than that without making numerous ass-pulls. – jpwrunyan Apr 13 '12 at 04:02

1 Answers1

0

I'm not familiar with flash, but it seems that you are dealing with homogeneous coordinates. If you are only dealing with vertices, it should be fine to leave it as 1.

Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47