Jump to content

  • Log In with Google      Sign In   
  • Create Account


Direct3D Rendering Matrices


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 drstrangeluv   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 February 2000 - 07:32 AM

I have the following problem. Despite the fact that it seems I''m setting up the world, view, and projection matrices properly, when I go to render a simple triangle centered around the origin, the triangle always appears in the upper left hand corner of the screen. If I try moving the camera (the view matrix) only, the triangle continues to stay in the upper left hand corner. Anyone have any thoughts on this? Thanks

Sponsor:

#2 Spellbound   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 February 2000 - 08:18 AM

Two questions that might help:

Have you set up your viewport correctly?

Are you sending D3DTLVERTEX to D3D? If you are you bypass Direct3D''s transformations and the matrices wont affect your coordinates.

#3 nes8bit   Members   -  Reputation: 274

Like
Likes
Like

Posted 16 February 2000 - 01:04 PM

please tell me that you remembered to send the matrix to the device!

#4 drstrangeluv   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 February 2000 - 02:54 PM

I''m definitely setting the matrices. Here is the code I''m using to draw the primitive:

IDirect3DDevice3_DrawPrimitive(lpDevice,D3DPT_TRIANGLELIST, D3DFVF_VERTEX,pvTriangleVertices, 6, NULL );

How could the setting of the viewport cause the kind of anomally I''m witnessing? I''m currently relying on someone else''s code to initialize the device and set the port, I''m just accessing the device.

#5 BigCarlito   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2000 - 07:35 AM

I think SpellBound is right, if your viewport size is smaller than the screen (and the viewport is rendering to the default position of 0,0) then the scene will just be smaller and in the upper left corner of the screen.

Good Luck!


#6 Doddler   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 February 2000 - 07:52 AM

Hello Again

I also ran into a problem with matrixes, but slightly different. The program displays the 3d object just fine, but when I try to apply a matrix, Nothing apears at all. I apply it like so...

m_pD3DDev->SetTransform(D3DTRANSFORMSTATE_WORLD, &gameship.matLocal );

and then render using...

m_pD3DDev->DrawPrimitive( D3DPT_TRIANGLELIST, D3DFVF_VERTEX, vTriangle, NUM_SHIPFACES, 0 );

but it doesn't display anything. If I comment the SetTransform line out, it works good.

If anyone can help me with this, I would be very thankful.

Thank you for your time...
-Doddler

Edited by - Doddler on 2/17/00 2:00:08 PM




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS