Note that there are some explanatory texts on larger screens.

plurals
  1. POXNA Get Mesh value of Y at value of X Reply
    primarykey
    data
    text
    <p>I am having trouble trying to get a loaded meshes value of Y at a value of X in order to perform some very limited version of detection. Essentially, I am going to get the value of X of a camera and detect if the Y value of my mesh is 5 for example. If so.. there is a wall there.</p> <p>I load my model with this:</p> <p>landscape = Content.Load("landscape");</p> <p>I draw the model with this:</p> <pre><code> foreach (ModelMesh mesh in landscape.Meshes) { if (mesh.Name != "Billboards") { foreach (BasicEffect effect in mesh.Effects) { effect.View = view; effect.Projection = projection; effect.LightingEnabled = true; effect.DirectionalLight0.Enabled = true; effect.DirectionalLight0.Direction = lightDirection; effect.DirectionalLight0.DiffuseColor = lightColor; //if (flashEnabled == true) //{ effect.DirectionalLight1.Enabled = flashEnabled; effect.DirectionalLight1.Direction = cameraFront; effect.DirectionalLight1.DiffuseColor = lightColor; effect.DirectionalLight1.SpecularColor = colorFlashLight.ToVector3(); //} effect.AmbientLightColor = ambientLightColor; effect.FogEnabled = fogEnabled; effect.FogColor = color.ToVector3(); effect.FogStart = 9.75f; effect.FogEnd = 10.25f; } device.BlendState = BlendState.Opaque; device.DepthStencilState = DepthStencilState.Default; device.RasterizerState = RasterizerState.CullCounterClockwise; mesh.Draw(); </code></pre> <p>}</p> <p>So moving on, in my update or input functions I would run an evaluative function to determine if LandscapeVertexY@CameraX is greater than a value of 5.</p> <p>Any help?</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.
    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