I am developing a space game, which is working on adding shadows to the planetary ring. For this I need to calculate that a cylinder (the shadow of the planet) pierces each other with an aircraft (the trap of the rings).
I am not able to see how 'sub' and 'jog' opodode deal with each component of a register. There is a graphic on this page that shows what each epode does; It describes extra and subtraction (among other calculations) in the form of 'component-wise'
Does this mean, if I am adding or subtracting 3D vectors, then X, Y , Z (and W?) Components will be affected independently of each other? And, if yes, then the registers know that not to do this, if adding or subtracting, say, number 2? Do I need to deal differently with each component for 3D vectors or just using 'Junk' or 'Sub', 2 vectors can be correctly added or reduced?
-
component-wise means connecting each vector component to each other / Deductible / etc. will be isolation. For example, adding two vectors together:
(x1, y1, z1, w1) + (x2, y2, z2, w2) = (x1 + x2, y1 + y2, z1 + z2 , W1 + w2)
-
If you need to add only a few components in arbitrary order, use vector swearing:
v1.xzy + V2.wwx = (v1 x + v2.w, v1.z + v2.w, v1.y + v2.x)
No comments:
Post a Comment