分享
 
 
 

山山讲堂 Maya建模教程之电话建模-Maya

王朝数码·作者佚名  2009-11-17
窄屏简体版  字體: |||超大  

本是想通过这篇教程介绍另外一种建模方法——鼎鼎大名的细分建模(Subdiv),但在录制过程中,由于惯性思维的影响,还是采用了多边形建模,不能不说是一个遗憾。为了弥补过失,我将在下一篇飞船建模的教程中与大家详细分享细分建模技术。

先来看一下最终的效果:

创建一个Cube,按照下图参数进行调整。

进入点级别,调整点的位置。

使用“Insert Edge Loop Tool”工具添加环线。

技巧:在使用Insert Edge Loop Tool工具的时候,为了一次性添加,我们可以打开改工具的设置选项,具体设置如下:

使用Extrude命令进行三次挤压,效果如下图所示。

添加环线,保留形状。

使用Extrude命令进行挤压。

添加环线,保留形状。

重复上面的方法,制作出下图所示部分。

使用Extrude挤压,并调整点的位置。

继续挤压。

使用“split polygon tool“添加线,保留形状。

挤压面,记住一定要关闭“keep faces together”选项。

添加环线,保留形状。

细分。

下面我们来制作话筒。

创建Cube,具体参数如下图所示。

F8进入点级别,调整点的位置。

添加环线,保留形状。

使用Extrude命令进行挤压。

重复上面的步骤,挤压出话筒部分。

细分。

制作电话线。这一部分比较难,但也比较简单。为什么这样说呢?如果你曾读过我前面的螺旋曲线教程的话,这里你只要写一个简单的MEL语言,就可实现我们想要的效果,如下图所示。

然后用户使用Surfaces下的Extrude命令就可实现电话线的制作。

今天换一个制作方法,我给大家提供专门制作电话线的脚本,这样更加方便快捷。

global proc phoneCord1( string $curv, float $numLoops )

{

int $numCvs, $i;

float $p, $min, $max, $angle, $uoff, $voff;

string $exp_str, $crv, $p_on_c;

int $cvsPerLoop = 4;

// We base the number of cvs on

$numCvs = (int) ($numLoops+.5) * $cvsPerLoop;

$crv = curve( "-d", 3, "-p", 0, 0, 0, "-k", 0, "-k", 0, "-k", 0 );

$min = getAttr( $curv + ".min" );

$max = getAttr( $curv + ".max" );

// create a curve with the required number of cvs

for( $i = 1; $i

{

curve -a -p ((float)$i) 0 0 $crv ;

}

// Add a loopOffset attribute to the spiral curve

addAttr -sn loff -ln loopOffset -dv 1.0 -min 0 -max 10 $crv;

setAttr -keyable on ($crv + ".loopOffset");

for( $i = 0; $i

{

$p = (float)$i/$numCvs;

$angle = $p * $numLoops * 6.28;

$uoff = -sin( $angle );

$voff = cos( $angle );

// we set the offset to zero for the start and end cvs

if( $i == 0 $i == $numCvs )

{

$uoff = 0;

$voff = 0;

}

$p = $min + ($max -$min) * $p;

// create a pointOnCurve node on the source curve

$p_on_c = pointOnCurve( "-ch", 1, "-parameter", $p, $curv );

// Create an expression to position the spiral

// cvs relative to the source curve using the

// point, normal and tangent from the pointOnCurve node

// A cross product is performed to give a vector perpendicular

// to the normal and tangent. The 2D rotation is then mapped to

// this vector and the normal.

expression -s ("$u = " + $uoff + " * " + $crv + ".loff;\n"

+ "$v = " + $voff + " * " + $crv + ".loff;\n"

+ "$nx = " + $p_on_c + ".nnx;\n"

+ "$ny = " + $p_on_c + ".nny;\n"

+ "$nz = " + $p_on_c + ".nnz;\n"

+ "$tx = " + $p_on_c + ".ntx;\n"

+ "$ty = " + $p_on_c + ".nty;\n"

+ "$tz = " + $p_on_c + ".ntz;\n"

+ $crv + ".cp[" + $i + "].xv = " + $p_on_c

+ ".px + ($ny * $tz - $ty * $nz) * $u + $nx * $v;\n"

+ $crv + ".cp[" + $i + "].yv = " + $p_on_c

+ ".py + ($tx * $nz - $nx * $tz) * $u + $ny * $v;\n"

+ $crv + ".cp[" + $i + "].zv = " + $p_on_c

+ ".pz + ($nx * $ty - $tx * $ny) * $u + $nz * $v;\n");

}

}

global proc xyphoneCord()

{

if ( `window -exists phoneCord` )

deleteUI xyphoneCord;

window

-maximizeButton false

-resizeToFitChildren true

-title "phoneCord"

-iconName "phoneCord" xyphoneCord;

columnLayout -columnAttach "both" 5 -rowSpacing 2 -columnWidth 210;

intFieldGrp -label "number" -v1 50 -cal 1 "left" phoneCordnumber;

button -label "select a curve,make cord" -c xymakecord;

showWindow xyphoneCord;

}

global proc xymakecord()

{

int $cordnum = `intFieldGrp -q -v1 phoneCordnumber`;

string $curveselect[];

$curveselect=`ls -sl`;

phoneCord1 $curveselect[0] $cordnum;

xyQuickTube;

createAndAssignShader blinn "";

}

proc string tube( string $cs ) // (curve shape)

{

string $t[];

if (objExists($cs) && (nodeType($cs)=="nurbsCurve"))

{

string$c=`createNode makeNurbCircle -n "baseCircle1"`;

string$s=`createNode subCurve -n "profileRange1"`;

string$e=`createNode extrude`;

string$r=`createNode nurbsSurface -n "tube1"`;

setAttr -e -k 0 ($c+".normal");

setAttr -e -k 0 ($c+".normalX");

setAttr -e -k 0 ($c+".normalY");

setAttr -e -k 0 ($c+".normalZ");

setAttr -e -k 0 ($c+".centerZ");

setAttr ($c+".radius") 0.1;

setAttr ($s+".minValue") 0.0;

setAttr ($s+".maxValue") 1.0;

setAttr ($s+".relative") 1;

setAttr ($e+".extrudeType") 2;

setAttr ($e+".useComponentPivot") 1;

setAttr ($e+".useProfileNormal") 1;

setAttr ($e+".fixedPath") 1;

setAttr -e -k 0 ($e+".directionX");

setAttr -e -k 0 ($e+".directionY");

setAttr -e -k 0 ($e+".directionZ");

setAttr -e -k 0 ($e+".useComponentPivot");

setAttr -e -k 0 ($e+".useProfileNormal");

setAttr -e -k 0 ($e+".fixedPath");

setAttr -e -k 0 ($e+".rotation");

setAttr -e -k 0 ($e+".scale");

setAttr -e -k 0 ($e+".length");

connectAttr ($c+".outputCurve") ($e+".profile");

connectAttr ($cs+".worldSpace") ($s+".inputCurve");

connectAttr ($s+".outputCurve") ($e+".path");

connectAttr ($e+".outputSurface") ($r+".create");

$t=`listRelatives -pa -p $r`;

}

return($t[0]);

}

//

// main procedure

//

//

global proc xyQuickTube()

{

string $sl[]=`ls -sl`, $s, $r[];

for($s in $sl)

{

string $sh[]=`listRelatives -pa -s $s`;

if ($sh[0]!="") $r[size($r)]=tube($sh[0]);

}

select -r -ne $r;

}

用户执行该段代码后,会弹出窗口。

用户选择一段曲线执行该命令,即可生成电话线。

将所有部件进行装配。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有