How do you reflect and object on a plane?
I have been asked to reflect an object about the plane z = 1.
I have attempted this with the following code.
D3DXMatrixReflect (&m_matWorld, D3DXPlane(0.0,0.0,1.0f) );
but the D3DXPlane identifier isn't found. First of all I would like to know if this is what I need and if it is then where should be defined?
If im totally wrong here let me know. If I find a solution to this before an answer is given. I will post what I did to prevent others from getting this problem.
Re: How do you reflect and object on a plane?
it's D3DXPLANE (all capitals) unless you have some specific library/class in use.
The source plane needs to be a pointer.
Assuming you have the C++ extensions enabled in DX:
Code:
D3DXPLANE z1(0.0, 0.0, 1.0, 0.0);
D3DXMatrixReflect (&m_matWorld, &z1 );
Whether this is what you're after is another matter.
Re: How do you reflect and object on a plane?
It look like the right thing. I am transforming between model to world and have the translate matrices already. I was just unsure about that section.
I will try what you have mentioned and see if it is fixed.
Thanks alot