Note that there are some explanatory texts on larger screens.

plurals
  1. POCamera (LootkAt + Orthogonal projection) doesn't want to work [SlimDX / D3D9]
    primarykey
    data
    text
    <p>I don't really understand how "cameras" work with D3D9</p> <p>First, how i set my camera up:</p> <pre><code> public Camera() { this.eye = new Vector3(0.0f, 0.0f, 0.0f); this.lookAt = new Vector3(0.0f, 0.0f, 1.0f); this.up = new Vector3(0.0f, 1.0f, 0.0f); viewMatrix = Matrix.LookAtLH(eye, lookAt, up); projectionMatrix = Matrix.OrthoLH(1 * zoomLevel, 1 * zoomLevel, 0.0f, 1.0f); } </code></pre> <p>And my vertices :</p> <pre><code> vertices = new VertexTexture[] { new VertexTexture() { Position = new Vector4(0.0f, 0.0f, 0.0f, 1.0f), TextureCoord = new Vector2(0.0f, 1.0f) }, new VertexTexture() { Position = new Vector4(0.0f, model.Height, 0.0f, 1.0f), TextureCoord = new Vector2(0.0f, 0.0f) }, new VertexTexture() { Position = new Vector4(model.Width, model.Height, 0.0f, 1.0f), TextureCoord = new Vector2(1.0f, 0.0f) }, new VertexTexture() { Position = new Vector4(model.Width, 0.0f, 0.0f, 1.0f), TextureCoord = new Vector2(1.0f, 1.0f) } }; </code></pre> <p>It works. I can move the camera, zoom, etc.</p> <p>But the cameras properties seems weird to me ! I thought it would be something like:</p> <pre><code> public Camera() { this.eye = new Vector3(0.0f, 0.0f, 1.0f); this.lookAt = new Vector3(0.0f, 0.0f, 0.0f); this.up = new Vector3(0.0f, 1.0f, 0.0f); viewMatrix = Matrix.LookAtLH(eye, lookAt, up); projectionMatrix = Matrix.OrthoLH(1 * zoomLevel, 1 * zoomLevel, 0.1f, 100.0f); } </code></pre> <p>but with that parameters it doesn't work. Same if i change the Z coordinate for my plan (Which need to be set at 0 to work).</p> <p>Now, i try to render other objects. I generate vertices for a sphere (it works fine on D3D 10, a 1 radius sphere generated around (0;0;0) ) but nothing appear on the screen</p> <p>I played with the eye and lookat parameters but i can figure how to make it work, so, what i m doing wrong ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload