-
December 6th, 2010, 07:54 AM
#1
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.
-
December 6th, 2010, 11:17 AM
#2
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.
-
December 7th, 2010, 07:20 AM
#3
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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|