当前位置: 首页 > news >正文

长宁广州网站建设网站后台文章编辑器

长宁广州网站建设,网站后台文章编辑器,阿里国际网站首页可以做全屏不,开发小程序费用主要学习了画空间圆柱体和空间长方形的绘制方法。有两个surface property#xff1a;FaceColor和EdgeColor’;先讲FaceColor’#xff0c;它指定了surface画出曲面的颜色#xff0c;可以是[r,g,b]的一个向量#xff0c;分别表示了红绿蓝的颜色配比#xff1b;也可以是inte…主要学习了画空间圆柱体和空间长方形的绘制方法。有两个surface propertyFaceColor和EdgeColor’;先讲FaceColor’它指定了surface画出曲面的颜色可以是[r,g,b]的一个向量分别表示了红绿蓝的颜色配比也可以是interp’画出来是由z的值决定的渐变色可以使用colormapeditor来调节颜色(在代码中写上colormapeditor即可唤出调色板)然后是EdgeColor’它会在曲面的表面画出网格指定颜色的方法同上。但是有一个疑问没有解决就是如何只显示各个棱的网格线而不是整个面的网格线这个留待后面继续摸索吧。surface(x,y,z)函数画出来的图像如果想要平移可以直接在带入参数时修改。比如沿z轴正方向平移10就是surface(x,y,z10);最后有一个实现视角自动旋转的小功能view(az,el)中az可以调节物体旋转的角度el调节摄像机的俯仰角度for i1:120view(i*1, 30);pause(0.01);end代码如下:function test()%%clear;clc;clf;z_delta 6;%% draw headA imread(head.jpg);[x,y,z]sphere(30);h0surface(x,y,z z_delta,EdgeColor,none);rotate(h0, [0,0,1], 90);set(h0,CData,A,FaceColor,texturemap);%texturemap纹理贴图%% draw body% FaceColor (orange)face_color interp; %[1, 0.6, 0];edge_color b;colormapeditor;% up board[x1,y1] meshgrid(-1:0.1:1, -1:0.1:1);z1 repmat(-1, 21, 21);h1surface(x1,y1,z1 z_delta, EdgeColor,edge_color,FaceColor,face_color);% left boardx2 repmat(1, 21, 21); y2 repmat([-1:0.1:1],21,1);for i1:21 for j1:21 z2(i,j)-1-(i-1)*0.25;endendh2surface(x2,y2,z2 z_delta,EdgeColor,edge_color,FaceColor,face_color);% right boardx3 repmat(-1, 21, 21);y3 repmat([-1:0.1:1],21,1);for i1:21 for j1:21 z3(i,j)-1-(i-1)*0.25; endendh3surface(x3,y3,z3 z_delta,EdgeColor,edge_color,FaceColor,face_color);%front boardy4 repmat(1, 21, 21); %#okx4 repmat([-1:0.1:1],21,1);for i1:21 for j1:21 z4(i,j)-1-(i-1)*0.25; endendh4surface(x4,y4,z4 z_delta,EdgeColor,edge_color,FaceColor,face_color);% back boardy5 repmat(-1, 21, 21);x5 repmat([-1:0.1:1],21,1);fori1:21 for j1:21 z5(i,j)-1-(i-1)*0.25; endendh5surface(x5,y5,z5 z_delta,EdgeColor,edge_color,FaceColor,face_color);%% draw armsrobot robot_model();r_arm 0.3;num_of_surf 36;for i2:5 if mod(i,2)1 color_arm r; else color_arm b; end [Cylinder(i),EndPlate1(i), EndPlate2(i)] cylinder3(robot(i).position, robot(i1).position, r_arm, num_of_surf, color_arm, 1, 0);endfor i7:10 if mod(i,2)1 color_arm r; else color_arm b; end [Cylinder(i), EndPlate1(i), EndPlate2(i)] cylinder3(robot(i).position,robot(i1).position, r_arm, num_of_surf, color_arm, 1, 0);end%% rotate the angle of viewgrid on;axis equal;axis fill;for i1:120 view(i*1, 30); pause(0.01);endend下面是由两个点画出一个空间圆柱体的代码从CSDN上下载的别人的程序就拿来直接用于画胳膊了。function [Cylinder, EndPlate1, EndPlate2] cylinder3(X1,X2,r,n,cyl_color,closed,lines)%% This function constructs a cylinder connecting two center points%% Usage :% [Cylinder EndPlate1 EndPlate2] cylinder3(X120,X2,r,n,r,closed,lines)%% Cylinder-------Handle of the cylinder% EndPlate1------Handle of the Starting End plate% EndPlate2------Handle of the Ending End plate% X1 and X2 are the 3x1 vectors of the two points% r is the radius of the cylinder% n is the no. of elements on the cylinder circumference (more-- refined)% cyl_color is the color definition like r,b,[0.52 0.52 0.52]% closed1 for closed cylinder or 0 for hollow open cylinder% lines1 for displaying the line segments on the cylinder 0 for only% surface%% Typical Inputs% X1[10 10 10];% X2[35 20 40];% r1;% n20;% cyl_colorb;% closed1;%% NOTE: There is a MATLAB function cylinder to revolve a curve about an% axis. This Cylinder provides more customization like direction and etc%%%%%%%%%%if (X1(1) X2(1))tmpX X1; X1 X2; X2 tmpX;end% Calculating the length of the cylinderlength_cylnorm(X2-X1);% Creating a circle in the YZ planetlinspace(0,2*pi,n);x2r*cos(t);x3r*sin(t);% Creating the points in the X-Directionx1[0 length_cyl];% Creating (Extruding) the cylinder points in the X-Directionsxx1repmat(x1,length(x2),1);xx2repmat(x2,1,2);xx3repmat(x3,1,2);% Drawing two filled cirlces to close the cylinderif closed1hold onEndPlate1fill3(xx1(:,1),xx2(:,1),xx3(:,1),r);EndPlate2fill3(xx1(:,2),xx2(:,2),xx3(:,2),r);end% Plotting the cylinder along the X-Direction with required length starting% from OriginCylindermesh(xx1,xx2,xx3);% Defining Unit vector along the X-directionunit_Vx[1 0 0];% Calulating the angle between the x direction and the required direction% of cylinder through dot productangle_X1X2acos( dot( unit_Vx,(X2-X1) )/( norm(unit_Vx)*norm(X2-X1)) )*180/pi;% Finding the axis of rotation (single rotation) to roate the cylinder in% X-direction to the required arbitrary direction through cross productaxis_rotcross([1 0 0],(X2-X1) );% Rotating the plotted cylinder and the end plate circles to the required% anglesif angle_X1X2~0 % Rotation is not needed if required direction is along Xrotate(Cylinder,axis_rot,angle_X1X2,[0 0 0])if closed1rotate(EndPlate1,axis_rot,angle_X1X2,[0 0 0])rotate(EndPlate2,axis_rot,angle_X1X2,[0 0 0])endend% Till now cylinder has only been aligned with the required direction, but% position starts from the origin. so it will now be shifted to the right% positionif closed1set(EndPlate1,XData,get(EndPlate1,XData)X1(1))set(EndPlate1,YData,get(EndPlate1,YData)X1(2))set(EndPlate1,ZData,get(EndPlate1,ZData)X1(3))set(EndPlate2,XData,get(EndPlate2,XData)X1(1))set(EndPlate2,YData,get(EndPlate2,YData)X1(2))set(EndPlate2,ZData,get(EndPlate2,ZData)X1(3))endset(Cylinder,XData,get(Cylinder,XData)X1(1))set(Cylinder,YData,get(Cylinder,YData)X1(2))set(Cylinder,ZData,get(Cylinder,ZData)X1(3))% Setting the color to the cylinder and the end platesset(Cylinder,FaceColor,cyl_color)if closed1set([EndPlate1 EndPlate2],FaceColor,cyl_color)elseEndPlate1[];EndPlate2[];end% If lines are not needed making it disapearif lines0set(Cylinder,EdgeAlpha,0)end
http://www.yutouwan.com/news/318965/

相关文章:

  • 哈尔滨企业做网站可以充值的网站怎么做
  • 国内做的好看的网站设计html5 php网站源码下载
  • 网站建设合同 程序wordpress导航栏做产品分类
  • 做网站运营公司收费建筑公司企业愿景范文简短
  • 学校网站 模板百度关键词规划师
  • 网站怎么找的怎么把网页发布到网上
  • 青岛开发区网站制作苏州网站建设最佳方案
  • 东莞建站wap网站生成
  • 关于做网站策划书做水果网站平台
  • 用内网穿透做网站可以被收录吗网站建设客户常见问题集锦
  • 电子商务网站方案网络推广龙岗比较好的
  • 做一家视频网站网站开发有前途么
  • 广东公司响应式网站建设报价企业微信营销软件
  • 网址导航网址大全彩票网站大全今天的热搜榜
  • 怎么做企业营销型网站学编程可以建设网站吗
  • 一个人做网站赚钱网络安全未来发展趋势
  • 湛江的网站建设公司网站开发面试题
  • 与做网站的人怎么谈判注册个公司大概多少钱
  • 搭建自己的个人网站云跟帖wordpress
  • 深圳广告网站设计制作企业网站怎么搜索优化
  • 西乡网站的建设莘县网站定制
  • 我市强化属地网站建设做新浪微博网站需要
  • 网站建设案例 优帮云住建局查询房产信息
  • 网站字号如何形容一个网站做的好
  • 做网站建设需要做哪些工作专业做二手网站
  • seo网站排名推广佛山新网站建设方案
  • 不是搜索网站的是python如何制作网页
  • 如何查找网站备案建模培训机构排名
  • 如何建设网站视频教程软件外包服务公司是做什么的
  • 品牌网站建设小h蝌蚪网络广告商