Şekil 9.2 Güneş sistemi modelleme uygulaması
utility gunesSistemi "Güneş Sistemi Modelleme" |
( |
-- Bu kod satırı kitaptadır. |
button olustur "Olustur" |
label yaz "Yazan: " across:2 |
hyperlink baglan "Nadir AKSOY" color:(color 0 0 255) address:"http://www.nadiraksoy.com" offset:[-15,0] |
label surum "Surum: 1.0 (25-11-2009)" |
-- Bu kod satırı kitaptadır. |
( |
-- Bu kod satırı kitaptadır. |
gezegenSayisi = gezegenSayisiDegeri.value |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
( |
-- Bu kod satırı kitaptadır. |
gezegen.pos = (random[30,30,-50] [120,120,50]) |
gezegen.wirecolor = (color 100 (random 0 255) (random 0 255)) |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
) |
viewport. resetallviews |
max tool zoomextents all |
max pancamera |
-- Bu kod satırı kitaptadır. |
playActiveOnly = false |
-- Bu kod satırı kitaptadır. |
) |
) |
Şekil 9.3 Eğik atış uygulaması
-- Yazan: Nadir AKSOY (http://www.nadiraksoy.com) |
-- Eğik Atış Uygulaması: |
-- Bu kod satırı kitaptadır. -- İsmi top, yarıçap değeri 10 birim olan bir küre olustur. |
aci = 49 -- Değeri 49 olan aci isminde bir değişken tanımla (Eğik atışın eğim değeri olarak kullanılacaktır.). |
v0 = 47 |
-- Bu kod satırı kitaptadır.-- Değeri, v0 isimli değişkenin değeri (MAXScript’de ? (soru işareti) karakteri, yorumlanan ve değeri işlenen en son değişkenin değerini ifade eder. Burada, bu satırdan önce yukarıdaki satırda en son işlenen değer v0 isimli değişkenin değeri olduğuna göre, ? karakterinin taşıdığı değer de bu değişkenin değeri (50) olacaktır.) ile aci isimli değişkenin kosinüs değerinin çarpılması ile elde edilen değer kadar olan v0x isminde bir değişken tanımla (Eğik atıştaki yatay ilk hız değeridir.). |
-- Bu kod satırı kitaptadır. |
ucSur = v0y/9.81 -- Değeri, v0y isimli değişkenin değerinin 9.81’e (yerçekimi ivmesi) bölünmesi ile bulunan değer kadar olan ucSur isminde bir değişken tanımla (Eğik atışta, cismin uçuş süresi değeridir.). |
xMax = v0x*ucSur -- Değeri, v0x isimli değişkenin değeri ile ucSur isimli değişkenin değerinin çarpılması ile elde edilen değer kadar olan xMax isminde bir değişken tanımla (Eğik atışta, cismin x ekseninde en fazla alabileceği yoldur.). |
hMax = (v0y^2)/(2*9.81) -- Değeri, v0y isimli değişkenin değerinin karesi kadar olan hMax isminde bir değişken tanımla (Eğik atışta, cismin çıkabileceği en yüksek noktanın değeridir.). |
animate on -- Canlandırma denetimini aç. |
( -- Canlandırma denetimi başı |
-- Bu kod satırı kitaptadır. -- 0’dan itibaren ucSur isimli değişkenin değerine kadar 0.5’er adımla artan bir sıralama oluştur ve bu değerleri i değişkenine ata (Başlangıç, v0x ve v0y noktalarından oluşan üç anahtar kare ile de canlandırma doğru gibi görünebilir. Fakat topun hareketinin hassas olabilmesi için (kesin ve uzmana yakışır bir yöntemle), 3DS MAX’in varsayılan olarak hareket başlangıcı ve bitişinde uyguladığı eğimin göz ardı edilmesi gereklidir.). |
( -- for i başı |
-- Bu kod satırı kitaptadır. |
at time canYar top.pos = [v0x*i/2,0,(v0y*i)-((9.81*(i^2))/2)] -- Belirtilen karelere kadar top isimli nesnenin konum değerini, x ve z eksenlerinde i isimli değişkende toplanan değerlerle, v0x ve v0y isimli değişkenlerin değerleriyle ifade edilen değerler kadar, y ekseninde 0 yap. |
-- Bu kod satırı kitaptadır. |
) -- for i sonu |
) -- Canlandırma denetimi sonu |
Şekil 9.4 Bağlantı noktası konumu canlandırma uygulaması (animatevertex)
-- Yazan: Nadir AKSOY (http://www.nadiraksoy.com) |
-- Bir Editable Spline Nesnesinin Bağlantı Noktası Konumlarının Canlandırılması Uygulaması (animatevertex): |
-- Bu kod satırı kitaptadır. |
halka.render_thickness = 1.5 |
halka.render_displayRenderMesh = true |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
select halka |
subobjectlevel = 1 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
bitis = animationrange.end.frame |
canlandırmaAraligi = #(baslangic,bitis) |
-- Bu kod satırı kitaptadır. |
noktaNumarasi = #(1,3) |
-- Bu kod satırı kitaptadır. |
izIndex2 = 3*(noktaNumarasi[2]-1)+2 |
-- Bu kod satırı kitaptadır. |
anahtarKare02 = addNewKey iz[izIndex1].controller canlandırmaAraligi[2] |
anahtarKare03 = addNewKey iz[izIndex2].controller canlandırmaAraligi[1] |
-- Bu kod satırı kitaptadır. |
anahtarKare02.value += [15,30,0] |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
Şekil 9.5 Değişen konum değerinin gösterilmesi uygulaması
(Bu çalışmanın kurgusu, G.Ü. G.E.F. Ort. Fen ve Matematik Alanları Eğt. Böl. Matematik Eğt. A.B.D. Öğr. Gör. Hilal GÜLKILIK tarafından yapılmıştır.)
-- Bu kod satırı kitaptadır. |
( |
nes.render_useViewportSettings = false |
nes.render_thickness = 0.25 |
nes.render_renderable = true |
-- Bu kod satırı kitaptadır. |
) |
-- Bu kod satırı kitaptadır. |
( |
kontrol = Float_Script() |
-- Bu kod satırı kitaptadır. |
kontrol.SetExpression eksen |
kontrol.addNode "kure" kure |
konum.kerning.controller = kontrol |
) |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
( |
x = degtorad t |
egri1 = 20*sin(x) |
egri2 = 20*cos(x) |
egri3 = (x/30) |
-- Bu kod satırı kitaptadır. |
) |
rotate egri -45 x_axis |
-- Bu kod satırı kitaptadır. |
nor = cylinder name:"X Ekseni" radius:0.5 height:9 heightsegs:1 wirecolor:red |
rotate nor 90 y_axis |
teg = cylinder name:"Y Ekseni" radius:0.5 height:9 heightsegs:1 wirecolor:green |
rotate teg -90 x_axis |
biNor = cylinder name:"Z Ekseni" radius:0.5 height:9 heightsegs:1 wirecolor:blue |
nor.parent = kure |
-- Bu kod satırı kitaptadır. |
biNor.parent = kure |
-- Bu kod satırı kitaptadır. |
rotate norVek 90 y_axis |
-- Bu kod satırı kitaptadır. |
rotate tegVek -90 x_axis |
-- Bu kod satırı kitaptadır. |
norVek.parent = nor |
tegVek.parent = teg |
biNorVek.parent = biNor |
-- Bu kod satırı kitaptadır. |
kure.position.controller = egriTakibi |
-- Bu kod satırı kitaptadır. |
konX = text name:"Konum X" pos:[10,-40,0] size:5 font:"Arial" wirecolor:red |
X = text name:"X" wirecolor:red pos:[-10,-40,0] size:5 font:"Arial" text:"nokta (x) :" |
nes konX "metin.text = kure.pos.x as string\n0" |
konY = text name:"Konum Y" wirecolor:green pos:[10,-49,0] size:5 font:"Arial" |
Y = text name:"Y" wirecolor:green pos:[-10,-49,0] size:5 font:"Arial" text:"nokta (y) :" |
nes konY "metin.text = kure.pos.y as string\n0" |
konZ = text name:"konum Z" wirecolor:blue pos:[10,-58,0] size:5 font:"Arial" |
Z = text name:"Z" wirecolor:blue pos:[-10,-58,0] size:5 font:"Arial" text:"nokta (z) :" |
nes konZ "metin.text = kure.pos.z as string\n0" |
-- Bu kod satırı kitaptadır. |
konB = text name:"konB" wirecolor:orange pos:[0,-31,0] size:5 font:"Arial" text:" Eksenlerde Aldigi Degerler:" |
konC = text name:"konC" wirecolor:red pos:[-45,10,0] size:5 font:"Arial" text:"Teget Vektör" |
-- Bu kod satırı kitaptadır. |
konE = text name:"konE" wirecolor:blue pos:[-45,-10,0] size:5 font:"Arial" text:"BiNormal Vektör" |
-- Bu kod satırı kitaptadır. |
egri.render_thickness = 1.5 |
max tool zoomextents all |
viewport.zoom 0.58 |
completeRedraw() |
playAnimation() |
Şekil 9.6 Bağlantı noktası konumu canlandırma uygulaması (animatevertex)
(Bu çalışmanın kurgusu, Zonguldak Karaelmas Üniversitesi E.E.F. İlköğretim Böl. İlköğretim Matematik Öğrt. A.B.D. Öğr. Gör. Mustafa AKINCI tarafından yapılmıştır.)
Kullanılan Komutlar |
- Create / addnewspline, addknot, shape
- updateshape
- copy
- Transformation
- convertToSplineShape
- for
|
- numSegments
- refinesegment
- numKnots
- animatevertex
- controller
- addNewKey
|
- getKnotPoint
- max tool
- viewport.zoom
- playAnimation()
|
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
addknot x_ekseni 1 #smooth #curve [-75,0,0] |
addknot x_ekseni 1 #smooth #curve [75,0,0] |
x_ekseni.pos = [0,-15,0] |
x_ekseni.render_useViewportSettings = false |
x_ekseni.render_displayRenderMesh = true |
x_ekseni.render_renderable = true |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
y_ekseni = copy x_ekseni name:"Y Ekseni" wirecolor:green |
y_ekseni.pos=[-15,0,0] |
rotate y_ekseni 90 z_axis |
cember = circle name:"cember" wirecolor:[255,0,0] |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
( |
for s2 = 1 to 2*numSegments cember 1 by 2 do refinesegment cember 1 s2 .5 |
) |
cember.render_useViewportSettings = false |
cember.render_displayRenderMesh = true |
cember.render_renderable = true |
cember.render_thickness = 0.5 |
-- Bu kod satırı kitaptadır. |
ikinciNokta = 31 |
konum = getKnotPoint cember 1 secilenNokta |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
addknot dogru 1 #corner #line [konum.x,konum.y,0] |
addknot dogru 1 #corner #line [konum2.x,konum2.y,0] |
dogru.render_useViewportSettings = false |
dogru.render_displayRenderMesh = true |
dogru.render_renderable = true |
dogru.render_thickness = 0.5 |
-- Bu kod satırı kitaptadır. |
dogru.pivot = konum |
-- Bu kod satırı kitaptadır. |
kureler = ($kure*) as array |
donenKure = kureler[secilenNokta] |
dogru.parent = donenKure |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
iz = dogru[4][8] |
noktaNumarasi = #(1,2) |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
copy dogru |
anahtarKare02 = addNewKey iz[izIndex1].controller canlandirmaAraligi[2] |
-- Bu kod satırı kitaptadır. |
for nok = 1 to 10 do |
( |
copy dogru |
anahtarKare03 = addNewKey iz[izIndex1].controller canlandirmaAraligi[nok+2] |
anahtarKare03.value = getKnotPoint cember 1 nok |
) |
dogru.render_thickness = 1 |
updateshape dogru |
max tool zoomextents all |
viewport.zoom 0.35 |
playAnimation() |
Şekil 9.7 Doğru parçasının belirtilen bir merkezde dönmesi uygulaması
(Bu çalışmanın kurgusu, Zonguldak Karaelmas Üniversitesi E.E.F. İlköğretim Böl. İlköğretim Matematik Öğrt. A.B.D. Öğr. Gör. Mustafa AKINCI tarafından yapılmıştır.)
-- Bu kod satırı kitaptadır. |
addnewspline egri |
-- Bu kod satırı kitaptadır. |
egri.render_thickness = 0.5 |
egri.render_useViewportSettings = false |
egri.render_displayRenderMesh = true |
egri.render_renderable = true |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
addnewspline dogru |
-- Bu kod satırı kitaptadır. |
addknot dogru 1 #corner #line [20,konum.y,0] |
dogru.render_thickness = 0.5 |
dogru.render_useViewportSettings = false |
dogru.render_displayRenderMesh = true |
dogru.render_renderable = true |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
rotate $kure05 45 z_axis |
-- Bu kod satırı kitaptadır. |
max tool zoomextents all |
viewport.zoom 0.50 |
playAnimation() |
Şekil 9.8 3 Boyutlu nesnelerde bağlantı noktası konumunu canlandırma uygulaması (animatevertex)
-- Bu kod satırı kitaptadır. |
convertToMesh monitor |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
( |
-- Bu kod satırı kitaptadır. |
at time 50 monitor[4][1][4].value *= [0.65,1,1] |
-- Bu kod satırı kitaptadır. |
at time 100 monitor[4][1][8].value *= [0.65,1,0.65] |
) |
Şekil 9.9 Yol üzerinde zamana göre hız uygulaması 01 (path_constraint)
-- Bu kod satırı kitaptadır. |
BezierDefaultParams.outTangentType = #linear |
animationrange = interval 0f 25f |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
tup.sliceFrom = 30 |
tup.sliceTo = -210 |
-- Bu kod satırı kitaptadır. |
rotate tup 90 x_axis |
-- Bu kod satırı kitaptadır. |
kure.pos = (tup.pos+[0,0,kure.radius]) |
-- Bu kod satırı kitaptadır. |
addnewspline yol |
addknot yol 1 #corner #line (tup.pos+[0,(tup.Height/2)-kure.radius,0]) |
-- Bu kod satırı kitaptadır. |
updateshape yol |
yol.parent = tup |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
kure.position.controller = iz1 |
-- Bu kod satırı kitaptadır. |
animate on |
( |
-- Bu kod satırı kitaptadır. |
at time sure rotate tup 180 x_axis |
) |
Şekil 9.10 Görünürlük kontrollerinin canlandırılması (visibility = bezier_float)
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
( |
nesne.visibility = bezier_float() |
with animate on |
( |
-- Bu kod satırı kitaptadır. |
duration = 50 |
at time (rastgele) nesne.visibility.controller.value = 0 |
-- Bu kod satırı kitaptadır. |
) |
) |
Şekil 9.11 Transform bilgilerinin zamana göre kontrolü (controller.script)
Şekil 9.12 Yol üzerinde zamana göre hız uygulaması 02 (path_constraint)
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
BezierDefaultParams.outTangentType = #linear |
mes = 70 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
addknot yol 1 #smooth #curve [mes,-mes,0] |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
yol.render_useViewportSettings = false |
yol.render_displayRenderMesh = true |
yol.render_renderable = true |
yol.render_rectangular = true |
yol.render_viewport_rectangular = true |
yol.render_Length = 1 |
yol.render_Width = 8 |
yol.render_angle2 = 30 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
animationrange = interval 0f 25f |
-- Bu kod satırı kitaptadır. |
topSay = 4 |
basBos = 2 |
bitBos = 2 |
animate on |
( |
-- Bu kod satırı kitaptadır. |
( |
kure = sphere prefix:"kure01" radius:5 segs:8 hemisphere:.5 chop:1 wirecolor:(random blue red) |
rotate kure - yol.render_angle2 x_axis |
-- Bu kod satırı kitaptadır. |
addModifier kure (Taper amount:.5) |
-- Bu kod satırı kitaptadır. |
addModifier kure (turbosmooth()) |
norBos = ((2*kure.radius)*100)/(curveLength yol 1) |
-- Bu kod satırı kitaptadır. |
iz.path = yol |
-- Bu kod satırı kitaptadır. |
at time 1 iz.percent = (basBos*ts*norBos) |
-- Bu kod satırı kitaptadır. |
) |
) |
completeRedraw() |
Şekil 9.13 Ranger modelleme ve canlandırma uygulaması (Orientation_Constraint)
(Bu çalışma, G.Ü. G.E.F. Ort. Fen ve Matematik Alanları Eğt. Böl. Matematik Eğt. A.B.D. Öğr. Gör. Elçin EMRE ve Gönül YAZGAN’ın çalışmalarının düzeltilmiş ve geliştirilmiş biçimidir.)
Kullanılan Komutlar |
- Utility
- fn
- Create / geometry
|
- Transformation
- for
- BezierDefaultParams.inTangentType
|
- BezierDefaultParams.outTangentType
- Animate on
- Orientation_Constraint()
|
utility ranMod "Ranger Modelleme" |
( |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
slider ayYar "Ayak Yaricapi" range:[3.5,12,7] |
slider anaBagYar "Ana Baglanti Yaricapi" range:[2.75,4.5,3.5] |
slider anaBagYuk "Ana Baglanti Yuksekligi" range:[8,12,10] |
slider bagUz "Baglanti Uzunlugu" range:[1.5,1.75,1.6] |
slider kolUz "Koltuk Uzunlugu" range:[6,8,7] |
slider kolYuk "Koltuk Yuksekligi" range:[3,5,4] |
label yaz "Yazan: " across:2 |
hyperlink baglan "Nadir AKSOY" color:(color 0 0 255) address:"http://www.nadiraksoy.com" offset:[-15,0] |
label surum "Surum: 1.0 (09-03-2010)" |
-- Bu kod satırı kitaptadır. |
( |
-- Bu kod satırı kitaptadır. |
tabGen = 150 |
-- Bu kod satırı kitaptadır. |
zem.Length = tabGen |
zem.Width = zem.Length*2 |
-- Bu kod satırı kitaptadır. |
anaBag = capsule name:"Ana Baglanti" radius:(ay.radius/anaBagYar.value) Height:(ay.radius*anaBagYuk.value) pos:[0, 0, ay.radius/2] |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
gob.pos = [0,(anaBag.radius/2)-anaBag.radius,anaBag.Height+anaBag.pos.z] |
gob.parent = anaBag |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
bag.pos = [0, gob.pos.y-gob.Height+(1.25*bag.Width), (gob.pos.z)-bag.Length/2] |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
kolZemCik.scale = [0.8,0.8,1] |
kolOtCik = copy kolZemCik name:"Koltuk Oturak Cikar" pos:(kolZemCik.pos-[0,0,(kolZemCik.Height/2)]) |
kolOtCik.scale = [0.35,0.8,1] |
cik1 = boolobj.createbooleanobject kol kolZemCik 4 1 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
boolobj.setboolop cik2 3 |
pim = capsule name:"Pim" radius:(gob.radius/5) Height:bag.Height pos:((bag.pos)-[0,-gob.radius/7,bag.Length/2-gob.radius/1.5]) |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
( |
-- Bu kod satırı kitaptadır. |
kopBag = instance bag wirecolor:(random [200,0,0] [200,255,100]) |
kopPim = instance pim |
kopKol.parent = kopPim |
kopPim.parent = kopBag |
kopBag.parent = gob |
kopKol.pivot = kopPim.pos |
-- Bu kod satırı kitaptadır. |
) |
delete kol; delete bag; delete pim |
-- Bu kod satırı kitaptadır. |
BezierDefaultParams.outTangentType = #linear |
animate on |
( |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
at time 100 about ay rotate anaBag -45 y_axis |
at time 100 rotate gob 1080 y_axis |
) |
-- Bu kod satırı kitaptadır. |
$kol*.rotation.controller = oc |
-- Bu kod satırı kitaptadır. |
) |
-- Bu kod satırı kitaptadır. |
on kolSay changed val do modelle() |
on ayYar changed val do modelle() |
on anaBagYar changed val do modelle() |
-- Bu kod satırı kitaptadır. |
on bagUz changed val do modelle() |
on kolUz changed val do modelle() |
on kolYuk changed val do modelle() |
) |
Şekil 9.14 Zincirli salıncak modelleme ve canlandırma uygulaması (LookAt_Constraint)
(Bu çalışma, G.Ü. G.E.F. Ort. Fen ve Matematik Alanları Eğt. Böl. Matematik Eğt. A.B.D. Öğr. Gör. Dr. Hakan ŞANDIR tarafından başlanan çalışmanın tamamlanmış biçimidir.)
Kullanılan Komutlar |
- Utility
- fn
- Create / geometry
- Transformation
- addModifier
|
- for
- position_list()
- position_XYZ()
- distance
- paramWire.connect
|
- LookAt_Constraint()
- group
- Animate on
- container
|
utility zinSalMod "Zincirli Salincak Modelleme" |
( |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
slider zemYar "Zemin Yaricapi" range:[2,3,2] |
slider govYuk "Govde Yuksekligi" range:[2.25,4.5,3] |
slider govYar "Govde Yaricapi" range:[0.1,0.4,0.2] |
slider catiYar "Cati Yaricapi" range:[1,2,1.75] |
slider catiYuk "Cati Yuksekligi" range:[0.1,0.8,0.2] |
slider sapYar "Sapka Yaricapi" range:[0.2,0.8,0.5] |
slider sapYuk "Sapka Yuksekligi" range:[0.3,1.25,0.75] |
slider askYar "Aski Yaricapi" range:[0.06,0.2,0.05] |
label yaz "Yazan: " across:2 |
hyperlink baglan "Nadir AKSOY" color:(color 0 0 255) address:"http://www.nadiraksoy.com" offset:[-15,0] |
label surum "Surum: 1.0 (11-03-2010)" |
-- Bu kod satırı kitaptadır. |
( |
-- Bu kod satırı kitaptadır. |
max time start |
boy = 200 |
halSay = 32 |
-- Bu kod satırı kitaptadır. |
zem.Fillet = zem.Height/2.5 |
zem.Height_Segments = 1 |
zem.Fillet_Segments = 6 |
-- Bu kod satırı kitaptadır. |
gov.radius = boy*govYar.value |
-- Bu kod satırı kitaptadır. |
gov.HeightSegs = 1 |
gov.capsegs = 1 |
gov.sides = 6 |
gov.pos = zem.pos |
-- Bu kod satırı kitaptadır. |
cati.radius = boy*catiYar.value |
cati.Height = boy*catiYuk.value |
cati.Fillet = cati.Height/4 |
cati.Height_Segments = 1 |
cati.Fillet_Segments = 3 |
cati.sides = kolSay.value |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
sap.radius1 = boy*sapYar.value |
sap.radius2 = 0 |
sap.Height = boy*sapYuk.value |
sap.HeightSegs = 1 |
sap.sides = kolSay.value |
sap.pos = cati.pos+[0,0,cati.Height] |
sap.parent = cati |
-- Bu kod satırı kitaptadır. |
ask.sides = 12 |
ask.HeightSegs = 1 |
-- Bu kod satırı kitaptadır. |
rotate ask -90 x_axis |
-- Bu kod satırı kitaptadır. |
zin.name = "zincir" |
zin.smooth = 2 |
zin.segs = 12 |
zin.sides = 6 |
zin.radius1 = boy*0.02 |
zin.radius2 = zin.radius1*0.3 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
rotate zin 90 y_axis |
-- Bu kod satırı kitaptadır. |
for i = 1 to halSay/2 do |
( |
-- Bu kod satırı kitaptadır. |
copUstZin.wirecolor = (color 100 (random 0 200) (random 0 255)) |
zin.pos.z -= 2*(2*zin.radius1*1.35) |
) |
rotate zin 90 z_axis |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
( |
copAltZin = instance zin prefix:"altZin" |
copAltZin.wirecolor = (color 100 (random 0 200) (random 0 255)) |
-- Bu kod satırı kitaptadır. |
) |
-- Bu kod satırı kitaptadır. |
kol.radius1 = boy/1.333 |
-- Bu kod satırı kitaptadır. |
kol.segs = 10 |
kol.sides = 5 |
kol.slice = true |
kol.sliceFrom = 20 |
kol.sliceTo = 340 |
rotate kol 90 x_axis |
-- Bu kod satırı kitaptadır. |
addModifier kol (lattice name:"tel kafes" Strut_Radius:(boy/66.666) Strut_Segments:1 Strut_Sides:6 Joint_Radius:0 Joint_Segs:1) |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
kol.pos.controller.available.controller = position_XYZ() |
kol.pos.controller.setActive 2 |
kol.pos.controller.setName 2 "kontrolBuradan" |
-- Bu kod satırı kitaptadır. |
( |
ustZin.pos.controller = position_list() |
-- Bu kod satırı kitaptadır. |
ustZin.pos.controller.setActive 2 |
ustZin.pos.controller.setName 2 "kontrolBuraya" |
mult = ((1-((distance ustZin kol)/360))^2)^0.75 |
-- Bu kod satırı kitaptadır. |
paramWire.connect kol.pos.controller[2] ustZin.pos.controller[2] wireStr |
) |
for altZin in $altZin* do |
( |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
altZin.pos.controller.setActive 2 |
altZin.pos.controller.setName 2 "kontrolBuraya" |
-- Bu kod satırı kitaptadır. |
wireStr = "kontrolBuradan*"+mult as string |
paramWire.connect kol.pos.controller[2] altZin.pos.controller[2] wireStr |
) |
for ustZin in $ustZin* do |
( |
-- Bu kod satırı kitaptadır. |
$ustZin*.rotation.controller = lcU |
lcU.appendTarget kol 50 |
lcU.StoUP_axis = 0 |
) |
for altZin in $altZin* do |
( |
-- Bu kod satırı kitaptadır. |
$altZin*.rotation.controller = lcA |
-- Bu kod satırı kitaptadır. |
lcA.StoUP_axis = 1 |
lcA.upnode_axis = 0 |
) |
lcO = LookAt_Constraint() |
-- Bu kod satırı kitaptadır. |
lcO.appendTarget zin 50 |
lcO.target_axis = 1 |
kol.parent = ask |
-- Bu kod satırı kitaptadır. |
redrawViews() |
group $ustZin* name:"ustZin" |
group $altZin* name:"altZin" |
setGroupOpen $ustZin true |
setGroupOpen $altZin true |
$ustZin.pos = [0,0,0] |
$altZin.pos = [0,0,0] |
-- Bu kod satırı kitaptadır. |
( |
at time 30 in coordsys local move $kol* [30,-100,20] |
at time 70 in coordsys local move $kol* [0,0,0] |
at time 100 in coordsys local move $kol* [-30,100,-20] |
at time 100 rotate gov 1440 z_axis |
) |
yat = container name:"yatma parcasi" size:50 |
-- Bu kod satırı kitaptadır. |
yat.localDefinitionFilename = konYat |
yat.accessContent = true |
yat.AddNodeToContent zin |
yat.AddNodeToContent $ustZin |
yat.AddNodeToContent $altZin |
yat.AddNodeToContent kol |
yat.AddNodeToContent ask |
yat.SaveContainer false |
yat.parent = cati |
for otSay = 1 to kolSay.value-1 do |
( |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
yat.parent = cati |
) |
) |
on olus pressed do |
( |
-- Bu kod satırı kitaptadır. |
max time play |
) |
on kolSay changed val do modelle() |
on govYuk changed val do modelle() |
on govYar changed val do modelle() |
on zemYar changed val do modelle() |
on catiYar changed val do modelle() |
on catiYuk changed val do modelle() |
on sapYar changed val do modelle() |
on sapYuk changed val do modelle() |
on askYar changed val do modelle() |
) |
Şekil 9.15 Zincirli salıncak modellemede kullanılan kontrolcüler 01
Şekil 9.16 Zincirli salıncak modellemede kullanılan kontrolcüler 02
Şekil 9.17 Karşılıklı top verme uygulaması (link_constraint)
yar = 4 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
rotate tup1 -(tup1.bend.angle-30) y_axis |
tup1.pivot = [yar*6.35,0,yar*17.325] |
top = sphere radius:((tup1.radius1+tup1.radius2)/2) segs:32 wirecolor:brown |
tup2 = copy tup1 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
tupDeg1 = animationrange.end*0.25 |
tupDeg2 = animationrange.end*0.75 |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. |
top.controller.addTarget tup2 tupDeg1 |
-- Bu kod satırı kitaptadır. |
topGec = 2 |
animate on |
( |
at time (tupDeg1-topGec) (rotate tup1 -45 y_axis; rotate tup2 45 y_axis; move top [0,0,0]) |
-- Bu kod satırı kitaptadır. |
at time (animationrange.end/2) (rotate tup1 45 y_axis; rotate tup2 -45 y_axis) |
at time (tupDeg2-topGec) (rotate tup1 -45 y_axis; rotate tup2 45 y_axis; move top [0,0,0]) |
at time tupDeg2 (rotate tup1 0 y_axis; rotate tup2 0 y_axis; move top [-(yar/2),0,0]) |
-- Bu kod satırı kitaptadır. |
) |
Şekil 9.18 Canlandırma yolunun şekle dönüştürülmesi (maxOps.trajectoryMode)
-- Bu kod satırı kitaptadır.-- İsmi prizma olan bir küp oluştur. |
animate on -- Canlandırma denetimini aç. |
( -- Canlandırma denetimi başı |
at time 50 prizma.pos = [0,-50,0] -- 50. kareye kadar, prizma isimli nesnenin konum değerini belirtilen değer kadar yap. |
at time 100 prizma.pos = [-50,-50,0] -- 100. kareye kadar, prizma isimli nesnenin konum değerini belirtilen değer kadar yap. |
) -- Canlandırma denetimi sonu |
select prizma -- Sahnede prizma isimli nesneyi seç. |
-- Bu kod satırı kitaptadır. |
-- Bu kod satırı kitaptadır. -- (Kullanıcı arayüzünde Motion panelindeki Trajectories kısmında bulunan Convert To isimli) butona 1 index numaralı seçeneği kullanarak bas. |
$Shape01.render_thickness = 0.5 -- Shape01 isimli şeklin çizgi kalınlık değeri 0.5 birim olsun. |
select $Shape01 -- Sahnede Shape01 isimli nesneyi seç. |
Başa Dön
|