ROLLING CUBES. NOT ROLLING STONES...

If you have the Flash plugin, wait to see and to hear a nice clip created by the official Beatles' site ( www.thebeatles.com):

Now imagine (imagine...) that you are trying to create a Croquet space about the "fabulous four".

This space can have a 3D window with a "book" about the Beatles' carreer. Do you remember what a "book" is? Review that old lesson.

It can have also a 3D model of a "yellow submarine" that the visitor can walk around or go inside.

The floor of the space can be an image related with the subject of the space.

It's possible also to have an "ambient sound" playing a Beatles' success - we will talk about ambient sound in Croquet soon.

And you can have, in the space, a big cube (or more than one) rotating, having photos of the boys.

This appear to be a dream? Something of the future?

Look:

WOW! It's "WonderLand"! (Now are you understanding the reason of the name "Croquet", the references to Alice etc. etc.?)

TIP: Be carefull, boys. Don't smoke too much.

I hope also that you understand that "correct dimensions" sometimes are not important. Croquet is not CAD! Like my girlfriend likes to say: sometimes size doesn't matter...

OK. Let's go: The subject of this lesson is: "scalable cubes". They are a very good resource to present photos in your space. But you can use them for many things - use your imagination.

Like we did with spheres, you can change the "scale" and have cubes of many sizes. And you can change the texture of each face.

First of all, download this new piece and the textures:

scalableCube.ase - in the folder scalableCube

face1.jpg - in the subfolder Textures

face2.jpg - in the subfolder Textures

face3.jpg - in the subfolder Textures

face4.jpg - in the subfolder Textures

faceup.jpg - in the subfolder Textures

facedown.jpg - in the subfolder Textures

We will repeat a little the lesson about spheres.

You can change the size and the textures. In the "initialize" method, of a new Class, use:

...
 
tframe := (TLoad3DSMax new initializeWithFileName: 
	   (FileDirectory pathFrom:
            {FileDirectory default pathName.  'Content'.   'name-of-the-piece'. 'scalableCube.ase'}) 
	   scale: new-scale  shadeAngle: 90.1 textureMode: GLReplace) frame. 
...

And the stepAt method will be (the value of the parameter can be changed) :

stepAt: currentTime

tframe addRotationAroundY: 1.

But this new method and statement is not enought to do our cube to dance.We will use startStepping inside the initialize method of the Class:

initialize

super initialize.
tframe := (TLoad3DSMax new initializeWithFileName: 
	   (FileDirectory pathFrom:
            {FileDirectory default pathName.  'Content'.   'scalableCube'. 'scalableCube.ase'}) 
	   scale: 0.5  shadeAngle: 90.1 textureMode: GLReplace) frame.
tframe collapse.
tframe boundsDepth: 3.
tframe initBounds.
self addChild: tframe.
tframe objectOwner: self.
inControl := false.
self startStepping.

Very easy. If you like, you can put also the method keyDown: pointer.

WARNING: Don't use the Beatles' images, you downloaded here, in any commercial space. I don't know if they are copyrighted...


PREVIOUS LESSON NEXT LESSON
T. CONTENTS HOMEPAGE

DISCLAIMER: This material can be translated for any language, and reproduced total or partially by anybody using any type of media. But, please, don't put your name like author. And let me know if it was useful (americo@dmu.com).The use of any code, 3D model or technique published is free and doesn't need to have any reference about this source.The author is not responsible for any damage that the material can cause to your professional or sexual life.