Results 1 to 6 of 6

Thread: Rotation ???

  1. #1

    Rotation ???

    I'm trying out rotation with Direct3D using the d3dx9 unit (and dll), however my object (a quad made out of 2 triangles) refuses to move an inch... I tried all sorts of combinations and positions, but it just refuses to work...

    I am using this FVF:
    const D3DFVF_CUSTOMVERTEX = ( D3DFVF_XYZRHW or D3DFVF_TEX1);
    and my guess is that the D3DFVF_XYZRHW isn't supported in rotation...
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  2. #2

    Rotation ???

    You are right you can't transform already transformed coordinates - D3DFVF_XYZRHW.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    Rotation ???

    It would be nice if Microsoft would provide that information in their help file!

    Thanks for your reply Clootie!
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  4. #4

    Rotation ???

    From Doc:
    Mapping FVF to DirectX 9.0 Decl
    D3DFVF_XYZRHW -> D3DDECLTYPE_FLOAT4 /D3DDECLUSAGE_POSITIONT / 0
    D3DDECLUSAGE_POSITIONT
    Vertex data contains transformed position data. (D3DDECLUSAGE_POSITIONT with UsageIndex = 0) specifies transformed position. When a declaration containing this is set, the pipeline does not perform vertex processing.
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    Rotation ???

    Would it be possible to convert (with some sort of formula) a pixel coordinate to the normal Direct3D coordinates?

    If so I could provide my Direct3D Wrapper with X,Y in pixel coords and let my Draw procedure convert them back to normal Direct3D (so without the RHW setting).

    At the moment I calculate the rotation coordinates myself, but doing it with Direct3D will probably be a bit faster and may look a bit better I guess!


    P.S. I'm using Direct3D for 2D drawing, so you might understand my need for Pixel/Screen coordinates
    Do it by the book, but be the author!
    <br />
    <br />Visit the Lion Productions website at:
    <br />http://lionprod.f2o.org

  6. #6

    Rotation ???

    Basically you are looking for something like ID3DXSprite that was designed to render 2D billboards/sprites in 3D.
    The same thing can be reached by
    1) D3DXMatrixOrthoLH(matrix, width, height, 1, 1000);
    2) SetMatrix(xxx_projection, matrix);
    3) Sending 3D (not 4D) coordinates like you do it now
    4) SetMatrix(xxx_world, rotation_matrix)

    PS. Current generation CPU, for example P4-2000Mhz can transform (with help of SSE) more than 5 millions vertices per second.
    There are only 10 types of people in this world; those who understand binary and those who don't.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •