
If you are a teacher (and many betatesters are) you know that a pedagogical resource, trying to teach some a "new thing", is to make a comparison of the unknowned and something that the student know.
That are ever an "smart boy" that will alert you that your comparison is not perfect - and really it's not. (He is not so smart because doesn't understand that you are only using a pedagogical trick...)
At our case, we are comparing - since some previous lessons - the actual WWW and the use of Squeak-Croquet. See the next figure that resumes what we are saying:
At this lesson you will do an exercice to create at YOUR Squeak-Croquet desktop and space (Solo), a Portal to a remote space that is at our server: www.dmu.com. We call this kind of Portals: "Remote Portals" - a little inadequate because is not the Portal that is remote...
This remote space will have now only 3D model but coud be one having many 3D windows having 2D Squeak projects that you could used - we will see an example of a more populated space at a lesson in the future. But, please, lets go step by step.
You will use now the Class Solo - we talked about the 3 main Classes: Private, Solo and Multi at previous lessons - created to construct the "container space" for Remote Portals.
To this Class (in the Package Browser) you will add the "make function":
makeRemotePortalToSpR8: sp | win winR tframe p pR url| "Creating a portal to the main space" p := TPortal new. "Creating a Remote Portal" pR := TPortal new. "Creating a remote 3D window to have the Remote Portal to the space spR" winR := TWindow new. winR translationX: 0 y: 0 z:3. "winR rotationAroundY: 135.0." winR contents: pR. "Importing the remote SpaceR" url := 'http://www.dmu.com/TeaLand/spaces/remoteSpR8.tea'. tframe := self loadURL: url. tframe addChild: winR. "Creating a 3D window to be in the main space" win := TWindow new. win translationX: -5 y: 0 z: -8 . win contents: p. "This window will contain the portal" sp addChild: win. "The space sp will be defined at initializeDefaultSpace" p linkPortal: pR.
CODE COMMENTS
This other code you know very well:
initializeDefaultSpace | space | "Create a new space" space := TSpace new. "Make a light" self makeLight: space. "Make a floor" self makeFloor: space fileName:'lawn.BMP'. "Create the Remote Portal" self makeRemotePortalToSpR8: space. ^space.
And the "script for Workspace" for the "Solo area" is similar to all the others scripts we have seeing:
sL:= Solo new. win2D:= SystemWindow new. lf:= LayoutFrame new. lf leftFraction:0. lf rightFraction:1. lf topFraction:0. lf bottomFraction:1. win2D setLabel: 'SOLO'. win2D addMorph: sL fullFrame:lf. win2D openInWorldExtent: 250@250. sL requestInitialSpace.
"Doit-izing" this application you will see the Portal and the remote space having a floor of black stones:
You can see the "legoic" inside the remote space:
And two other figures:
In the next lesson we will learn how to create and upload spaces to your webserver to be accessed by everybody. And we will begin, I hope, to have many "Croquet spaces" that we will access.
PREVIOUS LESSON NEXT LESSON T. CONTENTS HOMEPAGE
