[Pharo-dev] Merry Christmas!

Sven Van Caekenberghe sven at stfx.eu
Wed Dec 25 05:25:20 EST 2013


Very nice, cool idea, Alex !

On 25 Dec 2013, at 09:05, Alexandre Bergel <alexandre.bergel at me.com> wrote:

> Merry Christmas to all of you!
> 
> In a fresh 3.0 image:
> 
> -=-=--=-=--=-=--=-=--=-=-
> Gofer new smalltalkhubUser: 'ronsaldo' project: 'roassal3d'; package: 'ConfigurationOfRoassal3d'; load. (Smalltalk at: #ConfigurationOfRoassal3d) loadDevelopment
> -=-=--=-=--=-=--=-=--=-=-

People keep on forgetting that you can write this load expression much more elegantly:

===
Gofer new smalltalkhubUser: 'ronsaldo' project: 'roassal3d'; configuration; loadDevelopment.
===

Merry Christmas !

Sven

> Then do it:
> 
> -=-=--=-=--=-=--=-=--=-=-
> | view text x y el r  |
> text := '
> xx xx  xxxxx  xxxxx   xxxxx   x   x        xxxxx  x   x  xxxxx  x  xxxxx  xxxxx  xx xx    x    xxxxx  
> x x x  x      x   x   x   x   x   x        x      x   x  x   x  x  x        x    x x x  x   x  x      
> x   x  xxx    xxxx    xxxx     xxx         x      xxxxx  xxxx   x  xxxxx    x    x   x  xxxxx  xxxxx  
> x   x  x      x   x   x   x     x          x      x   x  x   x  x      x    x    x   x  x   x      x
> x   x  xxxxx  x   x   x   x     x          xxxxx  x   x  x   x  x  xxxxx    x    x   x  x   x  xxxxx
> '.
> view := R3View new.
> x := 0.
> y := 0.
> 
> mat := R3Material new diffuse: Color lightGray.
> mat specular: Color green.
> mat shininess: 10.0.
> 
> text linesDo: [ :line |
> 	line do: [ :c |
> 		(c = $x) ifTrue: [ 
> 			el := (R3CubeShape new color: Color green) element.
> 			el on: R3MouseClickDown do: [ :evt  |  R3Blink on: evt element. 
> 				r := (R3Rotate on: evt element by:  (R3Vector3 newX: -0.5)). view addAnimation: r ].
> 			el translateByX: x y: y negated z: 0.
> 			view add: el
> 		].
> 		x := x + 1
> 	].
> 	x := 0.
> 	y := y + 1.
> ].
> 
> view lightingModel: R3MultipassPerPixelLighting new.
> 
> view addInteraction: R3MouseControl new; addInteraction: R3KeyControlForMac new.
> view open
> -=-=--=-=--=-=--=-=--=-=-
> 
> Use keys: W A S D 
> Click on letters
> 
> Enjoy!
> 
> Cheers,
> The Profilers 
> 
> -- 
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> 
> 
> 
> 





More information about the Pharo-dev mailing list