Tuesday, 11 February 2014

Rendered in Occlusion is finished Esplande Dome


Assignment 2 Script Python

import maya.cmds as mc
import math

def createSphere ():
    sphereList = []
    nums = 1
    for each in range(nums):
        aX = 0
        aY = 0
        aZ = 0
        mysphere = mc.sphere(ssw=0, esw=180)
        mc.move(-0.6,-0.1,-0.3, mysphere[0])
        mc.rotate(180,0,0, mysphere[0])
        mc.scale(12,8,12.10, mysphere[0])
        sphereList.append(mysphere[0])
    return sphereList
 
def createPyramid ():
    pyramidList = []
    num = 18
    for each in range(num):
        aX = math.cos(each*0.1)*1
        aY = math.sin(each*0.1)*7.8
        aZ = math.cos(each*-0.1)*12.3
        mypyramid = mc.polyPyramid()
        print mypyramid
        facename =  "%s.f[0]"%mypyramid[0],"%s.f[2]"%mypyramid[0],"%s.f[3]"%mypyramid[0]
        print facename
        mc.polyDelFacet(facename)
        mc.move(0.7,aY,aZ, mypyramid[0])
        mc.rotate(390,37,40, mypyramid[0])
        if each >= 1:
            pyramidList.append(mypyramid[0])
    mc.delete('pPyramid1')
    return pyramidList
 
 

def makePattern (exPyramidCreate):
    myGrp = mc.group(exPyramidCreate)
    for each in range(45):
        myDup = mc.duplicate(myGrp)
        mc.rotate(0,each*-8,-0.4, myDup[0], pivot=[-0.7,-0.5,-0.5])
        #mc.rotate(-42,0,0, myDup[0])
        mc.move(0,0,0)
   
def myCreation():
    exPyramidCreate = createPyramid ()
    exSphereCreate = createSphere ()
    exmakePattern = makePattern (exPyramidCreate)
     
myCreation()

That is the Script i created for the Esplanade
I use sin and cos to bend in a semi circle and a half sphere as base

Slowly i understand what are function use for and math logic to identify each pyramid that i have use to form
my patterns
CHALLENGES 
For the challenges i have was the math logic cause of  the pyramid and the faces surrounding the sphere
the math part i really to understand each pyramid perimeters setting spacing of my objects keep it within the position and the size of the sphere

Understanding the function for creating a pattern
I had to set my source object for it to follow along as it duplicating each row accordingly
plus the pyramid has to touch the surface of my sphere

I created my half sphere using the original sphere and cutting it to half to form my dome and place it in the middle of the grid as my base

what i have learnt of for this assignment 
I learn about the function and math logic needed for this project and the scripting like using sin and cos for the assignment and MC.COMMANDS for the objects and the layout of the script for
the programming

Pattern Design for Python Programming
Chosen pattern from the esplanade






No comments:

Post a Comment