CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Post 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.

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    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.

  3. #3
    Join Date
    Dec 2010
    Posts
    2

    Talking 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
  •  





Click Here to Expand Forum to Full Width

Featured