
For the exercice of this lesson you can use any 3D model having an .ASE file created by 3ds max. But, if you are, like the majority, a poor guy, member of the community of the "3dsmax-less", you can use the .ASE file (and textures) downloaded at the lesson linked here. It is - if you are doing all our exercices - at your computer, at the path of the figure:
First of all you will create a new Class (subclass of TeapotMorph): Factory. We will use this class for the creation of all the remote spaces.
Like ever, we will have 3 scripts. The first is a "make function":
makeRemoteSpR8: sp
| spR tframe url |
"Creating a new space"
spR := TSpace new.
self makeLight: spR.
self makeFloor: spR fileName:'StoneFloor.BMP'.
"Add 3D models here"
tframe := (TLoad3DSMax new initializeWithFileName:
(FileDirectory pathFrom:
{FileDirectory default pathName. 'Content'.
'LegoicM'. 'avatarM.ASE'})
scale: 0.1 shadeAngle: 90.1 textureMode: GLReplace) frame.
tframe translationX: 20 y: -3 z: 20.
tframe rotationAroundY: 180.
tframe boundsDepth: 3.
tframe initBounds.
spR addChild: tframe.
"Exporting the remote space"
url := 'http://www.dmu.com/TeaLand/spaces/remoteSpR8.tea'.
TExporter export: spR asBinary:url.
CODE COMMENTS
We will use an "empty space for compilation" to see if the export was OK. So, you need to create the old:
initializeDefaultSpace | space | "Create an empty space for test purpose only" space := TSpace new. "Make a light" self makeLight: space. "Make a floor" self makeFloor: space fileName:'lawn.BMP'. "Creating the remote space - it will not appear!" self makeRemoteSpR8: space. ^space.
It's important to note that the remote space will not appear at this "empty space for compilation". It's only an alert saying that all was OK at the "doit-ization" of our code. If you did some errors they will appear, not the "empty space".
The "script for Workspace" has a message in the title:
fT:= Factory new. win2D:= SystemWindow new. lf:= LayoutFrame new. lf leftFraction:0. lf rightFraction:1. lf topFraction:0. lf bottomFraction:1. win2D setLabel: 'SEEING EMPTY SPACE: ALL IS OK!'. win2D addMorph: fT fullFrame:lf. win2D openInWorldExtent: 500@150. fT requestInitialSpace.
If all is really OK, you have the files (.TEA and textures) in that path and you need to upload them to your webserver - that needs to accept TEA files like mime-type. Similar we did at this previous lesson you need to create a new directory etc. (it's not "simectric" etc.). Look our WS_FTP:
TIP: If, after this exercice, you will make a test, creating a Remote Portal at your Solo area for this new remote space, erase first the file and folder created on your machine, to see better the results.
PREVIOUS LESSON NEXT LESSON T. CONTENTS HOMEPAGE
