Results 1 to 3 of 3

Thread: 3D Vertex to 2D render target co-ordinates

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Kent, England
    Posts
    2

    3D Vertex to 2D render target co-ordinates

    Hi, y'all,

    I'm having a small problem using DirectX7.
    I am creating a modeller application and use a VB form as the render target. If, for example, I render a simple primitive, such as a triangle, to the form, I want to be able to click on the primitive and then use GDI to place a 'selected' indication with node points for dragging. This works, but I find that when I cycle through the vertices of the primitive and perform manual World, View and Projection transformations (and a final 'flatten' matrix to convert using homogenous-w) the 'selected' indication is offset slightly from the original DirectX rendered primitive (i.e I end up with TWO triangles on the render target).

    Does anyone have some example code (NOT Retained Mode, but Immediate Mode) to help a poor DirectX beginner obtain the correct x,y co-ordinates (i.e the same as DirectX before it is passed to the Rasterizer)?

    Any help would be GREATLY appreciated!

  2. #2
    Zaei
    Guest
    Grrr... It would be easier with DX8, there are built in functions for this =).

    There might be a bug in your transformation code itself. I would also do a google search for Something along the lines of "Project D3D7 Immediate". That should turn up quite a few hits.

    Good luck.

    Z.

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2002
    Location
    Kent, England
    Posts
    2
    I'm aware that DX8 has functions for this, but since I'm using the DX7 SDK at the moment (and still getting to grips with things 3D), I wanted to have a crack with my existing set up.

    I must agree that the problem must lie in the transformations I'm applying, but the matrices are pulled from the DX7 SDK help and leave me but a few pixels out in both x and y co-ords.

    Hence the reason I'm searching for some example code.

    Thanks for looking though!

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