c# - How to load fbx model to XNA? -
i new xna, , try load model, not loaded properly.
the model looks in visual studio:
and looks when try display:
my code this:
matrix[] transforms = new matrix[billiardtable.bones.count]; this.billiardtable.copyabsolutebonetransformsto(transforms); foreach (modelmesh mesh in this.billiardtable.meshes) { foreach (basiceffect effect in mesh.effects) { effect.enabledefaultlighting(); effect.world = transforms[mesh.parentbone.index] * matrix.createrotationx(120) * matrix.createtranslation(vector3.zero); effect.view = matrix.createlookat(balls.first().cameraposition, vector3.zero, vector3.up); effect.projection = matrix.createperspectivefieldofview( mathhelper.toradians(45.0f), balls.first().aspectratio, 1.0f, 10000.0f); } mesh.draw(); }
Comments
Post a Comment