
Important pieces for any construction are stairs.
Please download these files:
Pay attention! We don't have .JPG files here. What means this?
Each piece has some colors or images (the Base, by example, has an image). One or more of these images/colors can be "default textures". The "default texture" of the walls of previous lessons, by example, is only a color: green. We will see, at this lesson, how we can create new pieces "derivated" from a piece we have, with a different texture/color. But, before this, you need to do, for the new pieces, the "standard steps" for pieces that don't have "actions":
Like all is allways the same, you will find these "standard steps"
Now, "how to create derivated pieces":
You ever download "standard pieces" from DMU (or, in the future, from some other sites, I hope) . This piece can have some .JPG files. By example, the piece Plate13x05x13 has the file: plate13x05x13.jpg. It defines the "default texture" of the piece, here only a gray color. Imagine that you would like to have a redPlate13x05x13 - red, of course. Step by step:
VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file! VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file! VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file!
WOW! I imagine that you will remember this forever...
Why need you NOT to change the name of this file? Because:
VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file! VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file! VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file!
Sorry, but this is really very important.
Now you have a new piece that you can use like all the others you have downloaded. But remember: before to use it inside Croquet, you need to do, for the new piece , the "standard steps" for pieces that don't have "actions":
Like all is allways the same, you will find these "standard steps"
Remember that, creating the "initialize" method you will not have the same name for the folder and for the name of the .ASE file:
initialize
super initialize.
tframe := (TLoad3DSMax new initializeWithFileName:
(FileDirectory pathFrom:
{FileDirectory default pathName. 'Content'. 'redPlate13x05x13'. 'plate13x05x13.ase'})
scale: 0.1 shadeAngle: 90.1 textureMode: GLReplace) frame.
tframe collapse.
tframe boundsDepth: 3.
tframe initBounds.
self addChild: tframe.
tframe objectOwner: self.
inControl := false.
Why? Because:
VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file! VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file! VERY IMPORTANT: The "name of a piece" is the name of the folder, not the name of the file!
Sorry, but this is the most commom error everybody does.
WOW! You will have some work to create a new piece but it's easy, after to learn and to do this many times.
AND NOW! A challenge for you!
You have all the resources anf knowledgement for the creation of the space of the figures. GO! GO!:
And, if you like to have a bigger challenge: put a 3D Remote Portal over the squared floor. Mama mia!
PREVIOUS LESSON NEXT LESSON T. CONTENTS HOMEPAGE
