1

I have a raytracing exercise similar to this one here: How to get a reflection vector?.

I understand how to do the calculations but I'm having trouble visualising the projections.

enter image description here

The answer is $r=(d-(n\cdot d)n)+(-(n\cdot d)n)=d-2(n\cdot d)n$.

I'm thinking that $\operatorname{proj} nd=(n\cdot d)n$ = the green line and $i$ just end up at $n$.

user
  • 154,566
Marcus
  • 19
  • Please recall that if the OP is solved you can evaluate to accept an answer among the given, more details here https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – user Sep 06 '18 at 20:14

1 Answers1

1

The key point is that

$$d+r=2(d-(d\cdot n)n)\implies r=d-2(d\cdot n)n$$

enter image description here

user
  • 154,566
  • @Marcus Sorry I lost a piece. Now it is fixed. – user Jul 28 '18 at 20:18
  • @Marcus That's the way how I can see it clear. From basic rules for vector summation $d+r$ is the red vector and this one is twice the projection vector of vector $d$ orthogonal to $n$ (we are of course assuming $n$ such that |n|=1). – user Jul 28 '18 at 20:19
  • Is this the correct way to see it? https://imgur.com/a/qvRQfxZ Thanks for the help! – Marcus Jul 28 '18 at 20:21
  • @Marcus Yes, just plot also the $-2\operatorname{proj} nd$ part and apply the parallelogram rule. – user Jul 28 '18 at 20:24