本是想通过这篇教程介绍另外一种建模方法——鼎鼎大名的细分建模(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;
}
用户执行该段代码后,会弹出窗口。

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

将所有部件进行装配。
