Jump to content
  • Advertisement
Sign in to follow this  
waiyam

Beginner problem of VertexBuffer

This topic is 4830 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How to change the origin to the coordinates 0,0 by using VertexBuffer? now the origin is in the top left corner of the window :) i can't found the details in sdk :( Thx for help !

Share this post


Link to post
Share on other sites
Advertisement
Are you wanting to change the way that coordinates are mapped to the screen (as in, the final 2D image) ??

Say, [0,0] is top-left, you want [0,0] to be bottom-left (common for drawing graphs)?

If so, D3DVIEWPORT9 and the various Projection Matrix functions are where you need to be looking.

I'm not a 100% sure what you mean by "How to change the origin to the coordinates 0,0 by using VertexBuffer?" - sorry [smile]

Cheers,
Jack

Share this post


Link to post
Share on other sites
i want to change the [0,0,0] to the centred of the screen ,

follow my 3D coordinates system

how to set by D3DVIEWPORT9 and the Projection Matrix ?

can you give me a example

Thx a lot !

ps. sorry for my bad english :P

Share this post


Link to post
Share on other sites
by using the SetViewport function ?

D3DVIEWPORT9 vp;
vp.X = 400; <- this
vp.Y = 300; <- and this ?
vp.Width = RenderTarget.Width;
vp.Height = RenderTarget.Height;
vp.MinZ = 0.0f;
vp.MaxZ = 1.0f;

SetViewport(vp);

assume the screen size is 800x600 ..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!