c# - SharpDX Toolkit models rendering inside out -


a little while ago decided switch xna sharpdx toolkit actively being supported , quite similar xna. while i've had no trouble @ creating 2d games decided attempt basic 3d game. can both model , it's texture load when renders shows texture on side facing away camera doesn't show @ in between.

this code using set environment.

    vector3 cameraposition = new vector3(0, 0, -10f * 2.5f);     vector3 cameratarget = vector3.zero;      boundingsphere modelbounds = model.calculatebounds();      float fovangle = mathutil.degreestoradians(45);     float aspectratio = (float)graphicsdevice.backbuffer.width / graphicsdevice.backbuffer.height;     float near = 0.01f;     float far = 100f;     float scaling = 10f / modelbounds.radius;      matrix translation = matrix.scaling(scaling) * matrix.rotationy((float)gametime.totalgametime.totalseconds) * matrix.translation(0, -modelbounds.center.y * scaling, 0);     matrix lookat = matrix.lookatlh(cameraposition, cameratarget, vector3.up);     matrix projection = matrix.perspectivefovlh(.9f, aspectratio, near, far); 

and code renders it.

    protected override void draw(gametime gametime)     {         graphicsdevice.clear(color.cornflowerblue);          model.draw(graphicsdevice, translation, lookat, projection);          base.draw(gametime);     } 

any given appreciated.


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -