梦想3d控件 2018.6.04最新更新
下载地址:http://www.mxdraw.com/ndetail_103.html1.增加COM接口,把常用的建模函数封闭成 com对象2.编写c#调用例子,比如创建一个衣柜,窗户等比如,创建衣框代码如下: view plain copy[*] axMxDrawX3d1.ShowTexturize = true;
[*] axMxDrawX3d1.Light = true;
[*] MxDraw3dMakeShape make = new MxDraw3dMakeShape();
[*] //第一块
[*] MxDraw3dShape shap = make.DoBox(0,0,0,800, 300, 15);
[*] MxDraw3dShapeTransformation s = new MxDraw3dShapeTransformation();
[*] MxDraw3dPoint pt = new MxDraw3dPoint();
[*] s.scale(pt, 1.0);
[*] MxDraw3dShapeTransformation m = new MxDraw3dShapeTransformation();
[*] MxDraw3dVector vec = new MxDraw3dVector();
[*] vec.x = -400;
[*] m.Move(vec);
[*] m.multiply(s);
[*] shap.TransformShape(m);
[*]
[*] MxDraw3dTexturedShape ts =make.CreateTexturedShape(shap);
[*] ts.SetTextureFileName("K:\\MxDraw3D6.0\\Bin\\vc100d\\Test\\wood01.bmp");
[*] ts.SetTextureMap(true);
[*] ts.SetTextureScale(true, 1, 1);
[*] ts.SetTextureRepeat(true, 1, 1);
[*] ts.SetTextureOrigin(true, 0, 0);
[*] ts.SetDisplayMode(3);
[*] axMxDrawX3d1.DrawEntity(ts);
[*]
[*] .......
[*]
[*] //第七块
[*]
[*] MxDraw3dShape shape7 = make.DoBox(0, 0, 0, 1000, 290, 15);
[*] MxDraw3dShapeTransformation r7 = new MxDraw3dShapeTransformation();
[*] MxDraw3dPoint ptRot7 = new MxDraw3dPoint();
[*] ptRot7.x = 1000;
[*] ptRot7.y = 300;
[*] ptRot7.z = 0;
[*] MxDraw3dVector pvRot7 = new MxDraw3dVector();
[*] pvRot7.x = 0;
[*] pvRot7.y = 1;
[*] pvRot7.z = 0;
[*] r7.Rotation(ptRot7, pvRot7, 90 * 3.14159265 / 180.0);
[*] MxDraw3dShapeTransformation s7 = new MxDraw3dShapeTransformation();
[*] MxDraw3dPoint ptMove7 = new MxDraw3dPoint();
[*] ptMove7.x = 0;
[*] ptMove7.y = 0;
[*] ptMove7.z = 0;
[*] s7.scale(ptMove1, 1.0);
[*] MxDraw3dVector pvMove7 = new MxDraw3dVector();
[*] pvMove7.x = -1000;
[*] pvMove7.y = 0;
[*] pvMove7.z = 0;
[*] MxDraw3dShapeTransformation m7 = new MxDraw3dShapeTransformation();
[*] m7.Move(pvMove7);
[*] m7.multiply(r7);
[*] m7.multiply(s7);
[*]
[*] shape7.TransformShape(m7);
[*] MxDraw3dTexturedShape ts7 = make.CreateTexturedShape(shape7);
[*] ts7.SetTextureFileName("K:\\MxDraw3D6.0\\Bin\\vc100d\\Test\\wood01.bmp");
[*] ts7.SetTextureMap(true);
[*] ts7.SetTextureScale(true, 1, 1);
[*] ts7.SetTextureRepeat(true, 1, 1);
[*] ts7.SetTextureOrigin(true, 0, 0);
[*] ts7.SetDisplayMode(3);
[*] axMxDrawX3d1.DrawEntity(ts7);
[*] axMxDrawX3d1.ZoomAll();
3.控件运行效果抓图:
http://www.mxdraw.com/images/editor/20180604/15280866044874570.png
http://www.mxdraw.com/images/editor/20180604/15280866116944120.png
http://www.mxdraw.com/images/editor/20180604/15280866148728575.png
http://www.mxdraw.com/images/editor/20180604/15280866165422651.png
这是二次开发还是一次开发呀 二次开发:handshake
页:
[1]