Jump to content
  • Advertisement
Sign in to follow this  
Nerdsley

World Space -- Screen Space

This topic is 4106 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

I am currently drawing my objects in the 3D World Space and I view the object by rotating and translating the camera. However, I would like to leave the world space coordinates unchanged and rotate my camera to get different views of my object. Then project the world space onto screen space. Then translate the pixels in the screen space. Is there an easy way to do this using the directx functions.

Share this post


Link to post
Share on other sites
Advertisement
Have you considered D3DXMatrixLookAtLH? It only takes three vectors (eye, look_at, up) and computes a view matrix.

Admiral

Share this post


Link to post
Share on other sites
Hi,

why do you want to translate the pixels in the screen space? Why don't you use something like

D3DXMatrixLookAtLH(&view, &eye, &at, &up);
d3dDevice->SetTransform(D3DTS_WORLD, &world);
d3dDevice->SetTransform(D3DTS_VIEW, &view);
d3dDevice->SetTransform(D3DTS_PROJECTION, &proj);


or a HLSL equivalent ?


I don't know a simple solution. My following idea is a little bit inefficient for only translating pixels in screen space.

You can do it in a post processing step. That means:

1) render the scene into a texture (instead into the backbuffer)
2) renden the texture (onto a quad) into the backbuffer,
while translating the texture coordinates in the pixel shader according to the pixel translation offset.

But then you have two rendering passes.

[Edit:] source tags added

[Edited by - Mr X on March 28, 2007 11:53:54 AM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!