Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

Setting up an orthographic projection.

4: Adsense

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
1 reply to this topic

#1 sepoto   Members   


Posted 28 January 2014 - 12:00 AM

I'm posting a link to the Visual Studio 2013 project:



What I have done is combine aspects of http://www.rastertek.com/tutdx11.html Tutorial 4 and Tutorial 11. I have also updated the code to use DirectXMath and also to use the latest incarnations of DirectX11 functions for the Windows 8.1 SDK.


I have three triangles drawn and two of them are closer to the camera than the first. It appears so since what I have right now is a vertex shader and pixel shader that are set up for a projection. What I have done is incorporate the disable the z buffer code with the vertex and pixel shader and model rendering capability from rastertek.com Tutorial 4.


What I am trying to create is an orthographic projection just like blenders top view where the change in the triangles size would not be apparent even though the triangles have different z values so I can set up a way to zoom in and zoom out. I'm pretty sure what has to be done is that the vertex shader has to be modified to project orthographically but I'm not really sure about how to go about that yet.


I tried following the texture shader code in Tutorial 11 but it's only for rendering a texture I think and what I am trying to render orthographically are three meshes.


I know the destructors need work. It is functional right now I need to work on memory de allocation I know that. There are a lot more changes that would have to be made to the code but whats getting to me right now is the displaying the projection. I tried replacing the projectionMatrix with orthoMatrix but for some reason it dose not display so I have to find out why. My goal at this point is to add instead of triangles some cylinders and I do have already some samples for assimp which is going to import cylinders instead of triangles so that I can set up an orthographic projection and change a zoom level on the what is now the triangles. 


I'm referring to Luna right now on how this might be done.


There is some question in my mind about how the zoom might be accomplished.


Thanks for any help...

Edited by sepoto, 28 January 2014 - 05:22 PM.

#2 Jason Z   Members   


Posted 28 January 2014 - 07:58 AM

For an orthographic projection, you should take a look in the DirectX documentation (in the downloadable SDK or online).  There are functions described in the docs that explain how to create an orthographic projection.


However, I would also recommend that you check with the license information of the projects that you are modifying to ensure that you can re-publish them online.  I'm not a lawyer, and I don't know how the Rastertek tutorials are licensed, but you probably shouldn't be posting modified code unless you are sure you are compliant...

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.