BROWSER HAS PAGES, CROQUET HAS 3D WEBOBJECTS - PART 2

At this lesson you will create one "webobject", upload it for your webhoster - your webserver - and, after this, try to load it again inside a new space, like we did in the previous lesson.

To have 3ds max is not really essencial to work with Croquet because this 3D models are, for the Squeak-Croquet GUI, only something like wallpapers for the Windows GUI. But it's the funny part of it...

DMU is creating , for Croquet, a type of LEGO system that, without any 3D tool for modeling, you will create customized sceneries for your spaces.

The idea is to offer, FREE available for download, many bricks/pieces - it's really something like LEGO - and you only need to define the position for each one of this "webobjects", moving then in the space and, after to find the ultimate positions, to do a kind of "Save".

This sounds a little like a dream? NO! It's not.

We have this "dream" working NOW! Take a look at some instructions - click the red arrows to go ahead - for the constructions of a set you can find in the course that is the sequence of this one (needs Flash plugin):

We hope to have many sets available soon, before Xmas...

OBSERVATION: You can use this idea and create a group of pieces too. In your style. To help the community of the "3dsmax-less".

Back to our lesson...

The exercice (you need to make all the exercices of our course or ,soon, will be lost) for today is the creation of a new "legoic" using the tricks you have learned at previous lesson.

The new "legoic" will be a Doctor:

So, you need to design a new face and a new chest. And the .JPG files for his clothes will be white. Don't try to be a Da Vinci. Try to have fun...

Create the new character inside a folder whose name will be: "Doctor". The complete path will be:

C:\Croquet\Content\Doctor\Textures

After this done, open the Squeak-Croquet environment and, like ever, everithing begins by the creation of a new Class: DoctorForWeb that will have only one "make function":

makeDoctorForWeb:sp

| url tframe |

url := 'http://www.dmu.com/TeaLand/spaces/doctor.tea'. 
tframe := (TLoad3DSMax new initializeWithFileName: 
	   (FileDirectory pathFrom:
            {'C:\Croquet'. 'Content'. 'Doctor'. 'avatarM.ASE'}) 
	   scale: 0.1 shadeAngle: 90.1 textureMode: GLReplace) frame.
tframe translationX: 0 y: -3 z: 0.
tframe boundsDepth: 3.
tframe initBounds.
TExporter export: tframe asBinary:url.
sp  addChild: tframe.

CODE COMMENTS

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 webobject and make a copy for test here"
self makeDoctorForWeb: space.
 ^space.

CODE COMMENTS

And the "script for Workspace":

mD:= DoctorForWeb new. 
win2D:=   SystemWindow new.
lf:= LayoutFrame new.
lf leftFraction:0.
lf rightFraction:1.
lf topFraction:0.
lf bottomFraction:1.
win2D setLabel: 'TO SEE THE DOCTOR'.
win2D addMorph: mD fullFrame:lf.
win2D openInWorldExtent: 400@200. 
mD requestInitialSpace.

CODE COMMENTS

"Doit-izing" our application you will see some messages:

And (Miracle! It works!) the webobject was created in the path you can follow in the figure:

The next step is to upload the files.

First you will put the file: doctor.tea at the directory: Tealand/spaces in your web server.

And the textures files in the new directory: doctor.

Note that the names of the directories in the server are not "simetric" with the directories/folders in your machine - we don't have the folder: Textures etc.

IMPORTANT WARNING: Your web server needs to accept the transmission of files .tea for these webobjects that are 3D models and .pr for webobjects that are Squeak 2D Projects - to be seeing in the next lesson. Talk to your webserver administrator about these "mime types". If you are not using a Windows server you need to think about the differences of .tea and .TEA etc.

The "homework" for you is to create an application that picks this webobject in the web and puts it in a space (like we did in the previous lesson). But you need to erase the folder Doctor in : C:\Croquet\Content\Doctor or Croquet can use the files inside it.




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.