Sunday, December 13, 2009

Putting all together

The final pictures:


DOWNLOAD LINK: http://influxgame.com/povray.zip

The keyboard texturing

Putting up a letter on each key was the trickiest part:

An array of all keys was created:



#declare row1Keys = array[17]{"Esc","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12", "NmLk", "Prnt", "Insr", "Delt" }
#declare row2KeysTop = array[14]{"``","!"," ","£","$","%","^","&","*","(",")","_","+", " "}
#declare row2KeysBtm = array[14]{"¬","1","2","3","4","5","6","7","8","9","0","-","=", "Backspace"}
#declare row3Keys = array[14]{"Tab","Q","W","E","R","T","Y","U","I","O","P","[","]", "~"}
#declare row4Keys = array[13]{"Caps Lock","A","S","D","F","G","H","J","K","L",":","@","Enter"}
#declare row5Keys = array[14]{"Shift","Z","X","C","V","B","N","M","<",">","?","Shift","Up", "End"}
#declare row6Keys = array[11]{"Ctrl","Fn","Win","Alt"," ","Alt Gr","Ctrl","RgtCl","Left","Down","Right"}


Then the following macro was able to create a key and put text on top of it:


// row 1
#local i = 0;
#while (i < 17)

object { keyboardKey (0.84, 0.6) translate<13.3*i, 0, 0>}
object { laptopKeyText(row1Keys[i]) translate <-4+13.3*i, 7.5, -0.5>}

#local i = i+1;
#end

//row 2
#local i = 0;
#while (i < 13)

object { keyboardKey (1, 1) translate<15*i, 0, -12>}
object { laptopKeyText(row2KeysTop[i]) translate <-5+15*i, 7.5, -9.5>}
object { laptopKeyText(row2KeysBtm[i]) translate <-5+15*i, 7.5, -15.5>}

#local i = i+1;
#end
object { keyboardKey (2, 1) translate<204, 0, -12>}
object { laptopKeyText(row2KeysBtm[13]) translate <15*13, 7.5, -15.5>}






The final result:

The keyboard

It would be easier of design a keyboard if a sample keyboard was available.
The following one was found and was put onto a 'graph paper':
The keyboard key was designed in the following way, as previously it's a combination of different basic shapes and intersection/difference commands:

Using macros and while loops the following keyboard was produced:

Phone modelling 2

After the phone base is modelled the other thing left to do are:
* Numpad
* Call control buttons
* The main big control button
* The screen frame
* The LCD display

Using phone_insides_stub object that was defined in the code numpad buttons can be modelled using difference/intersection commands:



#declare phone_singlekey_matrix = RoundBox(<-20.4,17,-3>,< 20.4,18.75,3>, 0.4)

#declare keypad_1 = intersection {
object {phone_singlekey_matrix translate <0, 0, 47.6>}
object {phone_insides_stub}
}

#declare keypad_2 = intersection {
object {phone_singlekey_matrix translate <0, 0, 41.4>}
object {phone_insides_stub}
}

#declare keypad_3 = intersection {
object {phone_singlekey_matrix translate <0, 0, 35.2>}
object {phone_insides_stub}
}

#declare keypad_4 = difference {
intersection {
object {phone_singlekey_matrix translate <0, 0, 29.0>}
object {phone_insides_stub}
}
object {
keypad_bigbutton_base
translate <0, 7, 19.5>
}
}


A similar technique was used to make the rest of the buttons:

Applying textures:

The phone modelling

The phone has a shape of a box and to be more precise the shape of a rounded box. Pov-ray does not support rounded boxes so an external plug-in had to be used.
The basic shape is rounded box minus two boxes (using difference command):
After the 'difference' is applied this is what we get:

Later the shape is further split into different parts using difference and intersection commands:
Code:
#declare phone_main_part = difference {
RoundBox(<-24.5,0,-55>,< 24.5,22,55>, 10.5)
box{<-24.5,-1,-55>,< 24.5,3.5,55>}
box{<-24.5,18.5,-55>,< 24.5,23,55>}
}

#declare volume_button = object {
box {<15.2, 9, -37.8>, <24.8, 14.4, -22.2>}

}

#declare phone_bottom_part = difference {
object { phone_main_part}
box{<-24.5,12,-55>,< 24.5,19,55>}
object { volume_button }
cylinder { <24.2, 10, 27>, < 30, 10, 27>, 4 }
cylinder { <22.2, 10, 27>, < 30, 10, 27>, 2 }
}

#declare phone_top_part = intersection {
object { phone_main_part}
box{<-24.5,12,-55>,< 24.5,19,55>}
}

#declare phone_insides_stub = object {
phone_top_part
scale <0.95,1.01,0.97>
no_shadow
}


#declare phone_chrome_edge = difference {
object { phone_top_part}
object { phone_insides_stub}
object { volume_button }
cylinder { <24.2, 10, 27>, < 30, 10, 27>, 4 }
no_shadow
}