Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed help converting pseudo-code to c#
    primarykey
    data
    text
    <p>I've been working on building an icosphere, and am almost done with it. </p> <p>Right now what I am trying to do is make it so that any triangles not facing the camera aren't added to the draw list, because I'm dealing with a lot of triangles, and am filling up the vertex buffer. I've managed to make it so the triangles facing the initial camera position are hidden (see attached images), but the hidden triangles do no update as I move the camera around.</p> <p>Here are the two images showing this: </p> <p><a href="http://i41.photobucket.com/albums/e262/cstgirllover/Cho/IcosphereCulledFront.png" rel="nofollow">http://i41.photobucket.com/albums/e262/cstgirllover/Cho/IcosphereCulledFront.png</a></p> <p><a href="http://i41.photobucket.com/albums/e262/cstgirllover/Cho/IcosphereCulledSide.png" rel="nofollow">http://i41.photobucket.com/albums/e262/cstgirllover/Cho/IcosphereCulledSide.png</a></p> <p>I've been using (pseudo)code from this site to help me get this far:</p> <p><a href="http://decadeengine.blogspot.com/2011/03/remove-back-facing-patches-before.html" rel="nofollow">http://decadeengine.blogspot.com/2011/03/remove-back-facing-patches-before.html</a></p> <p>but I cannot seem to find any corresponding code for this:</p> <pre><code>p_pGraphics-&gt;get_Matrix(eModelView) </code></pre> <p>That is from the last segment of code on the page, which fixes the problem I'm having. </p> <p>My surrounding code looks like this:</p> <pre><code>public float isFacing(Vector3 pos1, Vector3 pos2, Vector3 pos3, Camera dotCamera) { Vector3 temp1 = CalculateNormal(pos1, pos2, pos3); float dotp = Vector3.Dot(temp1, dotCamera.GetDirection * _________); return dotp; } </code></pre> <p>The equivalent code need to go in after "dotCamera.GetDirection * "</p>
    singulars
    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.
 

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