Sams teach yourself html 4 in 24 hours pdf




















While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest pearson. California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information.

This privacy statement applies solely to information collected by this web site. Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance.

Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions. Add To My Wish List. Part of the Sams Teach Yourself -- Hours series. Book Sorry, this book is no longer in print. Not for Sale. About Description Updates More Information. More Information. Overview Pearson Education, Inc. Collection and Use of Information To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including: Questions and Inquiries For inquiries and questions, we collect the inquiry or question, together with name, contact details email address, phone number and mailing address and any other additional information voluntarily submitted to us through a Contact Us form or an email.

Surveys Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Contests and Drawings Occasionally, we may sponsor a contest or drawing. Newsletters If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information informit. Service Announcements On rare occasions it is necessary to send out a strictly service related announcement.

Customer Service We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form. Other Collection and Use of Information Application and System Logs Pearson automatically collects log data to help ensure the delivery, availability and security of this site.

Web Analytics Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. Cookies and Related Technologies This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising.

Security Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure. Children This site is not directed to children under the age of For example, as a point moves to the right, its x axis value gets larger. When it moves left, the x axis value gets smaller until it passes through the origin.

At that time, the x value of the point begins getting larger again, but it also becomes negative. Consider Figure 2. This 2D coordinate system has three points defined.

The point 2, 2 is 2 units away from the origin in both the x and y directions. The point —3, 3 is 3 units to the left of the origin and 3 units above the origin. The point 2, —2 is 2 units to the right of the origin and 2 units below the origin. World Versus Local Coordinates You have now learned about the dimensions of a game world and about the coordinate systems that compose them.

What you have been working with so far is considered the world coordinate system. At any given time, there is only a single x, y, and z axis in the world coordinate system.

Likewise, there is only one origin that all objects share. What you might not know is that there is also something called the local coordinate system. This system is unique to each object, and it is completely separate from other objects. You might be wondering what the local coordinate system is for if the world coordinate system is used for the position of objects. Later in this hour, you will look at transforming game objects and at parenting game objects. Both of these require the local coordinate system.

Game Objects Every shape, model, light, camera, particle system, and so on in a Unity game all have one thing in common: They are all game objects. The game object is the fundament unit of any scene. Even though they are simple, they are very powerful. At their root, game objects are little more than a transform as discussed in greater detail later in the hour and a container.

This container exists to hold the various components that make objects more dynamic and meaningful. What you add to your game objects is up to you. There are many components, and they add a huge amount of variety. Throughout the course of this book, you will be learning to use many of these components.

Note: Built-In Objects Not every game object you use will start as an empty object. Unity has several built-in game objects available to use right out of the box. You can see the large amount of items available by clicking the GameObject menu item at the top of the Unity editor and hovering over Create Other. A large portion of learning to use Unity is learning to work with built-in and custom game objects.

You will be creating a few basic objects and examining their different components: 1. Create a new project or create a new scene in a project you already have. Look in the Inspector view and notice how the game object you just created has no components other than a transform. All game objects have a transform. Clicking the Add Component button in the Inspector will show you all the components you could add to the object. Add a cube to your project by clicking the GameObject menu item, hovering the cursor over Create Other, and selecting Cube from the list.

The mesh components make the cube visible, and the collider makes it able to interact with other objects. Finally, add a point light to your project by clicking the Create drop-down in the Hierarchy view and selecting Point Light from the list.

You might also notice that your other objects went dark when the light was added to the scene. This is normal. Because a light exists in the scene, Unity turns off its ambient lighting.

Transforms At this point, you have learned and explored the different coordinate systems and experimented with some game objects. It is time to put the two together. When dealing with 3D objects, you will often hear the term transform. Depending on the context, transform is either a noun or a verb. All objects in 3D space have a position, a rotation, and a scale.

Unity combines the two meanings of the word with the transform component. You will recall that the transform component is the only component that every game object has to have. Even empty game objects have transforms. Using this component, you can both see the current transform of the object as well as change or transform the transform of the object. It might sound confusing now, but it is fairly simple.

You will get the hang of it in no time. Because the transform is made up of the position, rotation, and scale, it stands to reason that there are three separate methods called transformations of changing the transform: translation, rotation, and scaling respectively.

These transformations can be achieved using either the Inspector or the transform tools. Figures 2. Translation Changing the coordinate position of an object in a 3D system is called translation, and it is the simplest transform that you can apply to an object.

When you translate an object, it is shifted along an axis. When you select the Translate tool hotkey: W , you will notice that whatever object you have selected will change slightly in the Scene view. More specifically, you will see three arrows appear pointing away from the center of the object along the three axes. These are translation gizmos, and they help you move your objects around in the scene.

Clicking and holding on any of these axis arrows causes them to turn yellow. Then, if you move your mouse, the object will move along that axis. Note that the gizmos appear only in the Scene view; if you are in the Game view, you will not see them.

Knowing when to use each is important. The transform tools, however, are more useful for quick, small changes. Learning to use both together will greatly improve your workflow. Rotation Rotating an object does not move it in space.

More simply stated, rotation enables you to redefine which direction the x, y, and z axes for a particular object point. When an object rotates around an axis, it is said to be rotating about that axis. Tip: Determining the Axis of Rotation If you are unsure which axis you need to rotate an object about to get a desired effect, you can use a simple mental method. One axis at a time, pretend that the object is stuck in place by a pin that is parallel with that axis.

The object can only spin around the pin stuck in it. Now, determine which pin allows the object to spin the way you want. That is the axis you need to rotate the about around. Just as with the Translate tool, selecting the Rotate tool hotkey: E causes rotation gizmos to appear around your object. Clicking and dragging on any of these circles turns them yellow and rotates the object about that axis.

Scaling Scaling causes an object to grow or shrink within a 3D space. This transform is really straightforward and simple in its use. Scaling an object on any axis causes its size to change on that axis. Hazards of Transformations As mentioned before, transformations use the local coordinate system. Therefore, the changes that are made can potentially impact future transformations. Notice how the same two transformations, when applied in reverse order, have very different effects.

As you can see, not paying attention to transformation order can have unexpected consequences. Luckily, the transformations have consistent effects that can be planned on: Translation: Translation is a fairly inert transformation.

Rotation: Rotation changes the orientation of the local coordinate system axes. Any translations applied after a rotation would cause the object to move along the new axes. If you were to rotate an object degrees about the z axis, for example, and then move in the positive y direction, the object would appear to be moving down instead of up.

Scaling: Scaling effectively changes the size of the local coordinate grid. Basically, when you scale an object to be larger, you are really scaling the local coordinate system to be larger.

This causes the object to seem to grown. This change is multiplicative. For example, if an object is a scaled to 1 its natural, default size and then translated 5 units along the x axis, the object appears to move 5 units to the right.

If the same object were to be scaled to 2, however, then translating 5 units on the x axis would result in the object appearing to move 10 units to the right. This is because the local coordinate system is now double the size and 5 times 2 equals Inversely, if the object were scaled to. Once you understand these rules, determining how an object will change with a set of transformations becomes easy. Recall that when you have an object nested inside another one, the top-level object is the parent, and the other object is the child.

Transformations applied to the parent object work as normal. The object can be moved, scaled, and rotated. Therefore, a child object position is not based on its distance from the origin, but the distance from the parent object.

If the parent object is rotated, the child object would move with it. The same goes for scaling. If you scale the parent object, the child also changes in size.

The scale of the child object would remain unchanged. You might be confused by why this is. The effect is that the object turns. Summary In this hour, you learned all about game objects in Unity. You started off by learning all about the differences between 2D and 3D.

You then began working with game objects, including some of the built-in ones. You ended by learning all about transforms and the three transformations. You got to try out the transforms, learn about some of the hazards, and how they affect nested objects.

Is it important to learn both the 2D and 3D concepts? Even games that are entirely 3D still utilize some of the 2D concepts on a technical level.

Should I learn to use all the built-in game objects right away? Not necessarily. There are many game objects, and it can be overwhelming to attempt to learn them all right away. Take your time and learn about the objects as they are covered here. What is the best way to get familiar with transforms?

Keep working with them; eventually, they will become quite natural. What does the D in 2D and 3D stand for? How many transformations are there? True or False: Unity has no built-in objects and you must create your own. Unity provides many built-in objects for you.

Translate and then rotate. You will get a better feel for exactly how the coordinate systems change the way things are oriented. Create a new scene or project.

Add a cube to the project and place it at 0, 2, —5. Remember the shorthand notation for coordinates. The cube should have an x value of 0, a y value of 2, and a z value of —5. You can set these values easily in the transform component in the Inspector view. Add a sphere to your scene. Nest the sphere under the cube by dragging the sphere in the Hierarchy view onto the cube. Notice how the position values changed. The sphere is now located relative to the cube. Place the sphere at 0, 1, 0.

Now experiment with the various transformations. Be sure to try them on the cube as well as the sphere and see how different they behave for a parent versus a child object. Hour 3. You start by looking at the fundamental principles of meshes and 3D objects. From there, you learn how to import your own models or use ones acquired from the Asset Store.

In 2D games, the graphics consist of flat images called sprites. In worlds with a third axis, objects need to have volume to fool the eye. Because games use a large number of objects, the need to process things quickly was very important. Enter the mesh. A mesh, at its most simple, is a series of interconnected triangles.

These triangles build off of each other in strips to form basic to very complex objects. These strips provide the 3D definitions of a model and can be processed very quickly. Note: Why Triangles? You might be asking yourself why 3D objects are made up entirely of triangles. The answer is simple. Computers process graphics as a series of point, otherwise known a s vertices.

The fewer vertices an object has, the faster it can be drawn. Triangles have two properties that make them desirable. The first is that whenever you have a single triangle, you need only one more vertex to make another. To make one triangle, you need three vertices, two triangles take only four, and three triangles require only five.

This makes them very efficient. The second is that by using this practice of making strips of triangles, you can model any 3D object. No other shape affords you that level of flexibility and performance. Note: Model or Mesh? The terms model and mesh are similar, and you can often use them interchangeably. There is a difference, however. A mesh contains all the vertex information that defines the 3D shape of an object. When you refer to the shape or form of a model, you are really referring to a mesh.

A model, therefore, is an object that contains a mesh. A model has a mesh to define its dimensions, but it can also contain animations, textures, materials, shaders, and other meshes.

A good general rule is this: If the item in question contains anything other than vertex information, it is a model; otherwise, it is a mesh. Built-In 3D Objects Unity comes with a few basic built-in meshes or primitives for you work with. These tend to be simple shapes that serve simple utilities or can be combined to make more-complex objects.

Figure 3. You worked with the cube and sphere in the previous hours. Nesting objects in Unity enables you to easily make simple models using the built-in meshes. Just place the meshes near each other so that they form the rough look you want.

Then nest all the objects under one central object. This way, when you move the parent, all the children move, too.

This might not be the prettiest way to make models for your game, but it will do in a pinch! Importing Models Having built-in models is nice, but most of the time, your games will require art assets that are a little more complex. Thankfully, Unity makes it rather easy to bring your own 3D models into your projects. Just placing the file containing the 3D model in your Assets folder is enough to bring it into the project.

From there, dragging it into the scene or hierarchy builds a game object around it. Natively, Unity supports. This enables you to work with just about any 3D modeling tool. Create a new Unity project or scene. In the Project view, create a new folder named Models under the Assets folder. Locate the Torus. In Unity, click the Models folder to see the new Torus file. If done correctly, your Project view will resemble Figure 3.

Notice the Materials folder that was added for you. You will learn more about this later. Click the Torus asset in the Models folder and look at the Inspector view. Change the value of the scale factor from 0. Drag the Torus asset from the Models folder onto the Scene view. Notice how a Torus game object was added to the scene containing a mesh filter and mesh rendered. These allow the Torus to be drawn to the screen. If you click the Torus object, you see how it is made up of many connected triangles.

Caution: Default Scaling of Meshes Most of the Inspector view options for meshes are advanced and are not covered right now. The property you are interested in is the scale factor. By default, Unity imports meshes scaled down. By changing the value of the scale factor from 0. The Asset Store provides a simple and effective way to find premade models and import them into your project. Generally speaking, models on the Asset Store are either free or paid and come alone or in a collection of similar models.

Some of the models come with their own textures, and some of them are simply the mesh data. We will be acquiring a model named Robot Kyle and importing it into our scene: 1. In the Project view, type t:Model into the search bar see Figure 3. Locate Robot Kyle and select it. In the Inspector view, click Import Package. At this point, you may be prompted to provide your Unity account credentials. When the Importing Package dialog opens, leave everything checked and select Import.

There will now be a new asset folder called Robot Kyle. Note that the model will be fairly small in the Scene view; you might need to move closer to see it. Textures, Shaders, and Materials Applying graphical assets to 3D models can be daunting if you are not familiar with it. Unity uses a simple and specific workflow that gives you a lot of power when determining exactly how you want things to look.

Graphical assets are broken down into textures, shaders, and materials. Each of these is covered individually in its own section, but Figure 3. Notice that textures are not applied directly to models. Instead, textures and shaders are applied to materials. Those materials are in turn applied to the models. This way, the look of a model can be swapped or modified quickly and cleanly without a lot of work. Textures Textures are flat images that get applied to 3D objects.

They are responsible for models being colorful and interesting instead of blank and boring. It can be strange to think that a 2D image can be applied to a 3D model, but it is a fairly straightforward process once you are familiar with it. Think about a soup can for a moment. If you were to take the label off of the can, you would see that it is a flat piece of paper.

That label is like a texture. After the label was printed, it was then wrapped around the 3D can to provide a more pleasing look. Just like all other assets, adding textures to a Unity project is easy.

Start by creating a folder for your textures; a good name would be Textures. Then drag any textures you want in your project into the Textures folder you just created. Imagining how textures wrap around cans is fine, but what about more complex objects? When creating an intricate model, it is common to generate something called an unwrap. The unwrap is somewhat akin to a map that shows you exactly how a flat texture will wrap back around a model.

It looks strange, but that is the unwrapped texture for the model. The generation of unwraps, models, and textures is an art form to itself and is not covered in this text. A preliminary knowledge of how it works should suffice at this level. Caution: Weird Textures Later in this hour, you will apply some textures to models. You might notice that the textures warp a bit or get flipped in the wrong direction.

Just know that this is not a mistake or an error. This problem occurs when you take a basic rectangular 2D texture and apply it to a model. The model has no idea which way is correct, so it applies the texture however it can. If you want to avoid this issue, use textures specifically designed for unwrapped for the model that you are using.

Shaders If the texture of a model determines what is drawn on its surface, the shader is what determines how it is drawn. This might seem nonsensical right now, but later when we create materials you will begin to understand how they work. Much of the information about shaders is covered later this hour, because you cannot create a shader without a material.

Tip: Thought Exercise If you are having trouble understanding how a shader works, consider this scenario: Imagine you have a piece of wood. The physicality of the wood is its mesh; the color, texture, and visible element are its texture. Now take that piece of wood and pour water on it. The wood still has the same mesh. It still is made of the same substance wood.

It looks different, though. It is slightly darker and shiny. The water in this example is the shader. The shader took something and made it look a little different without actually changing it. Materials As mentioned earlier, materials are not much more than containers for shaders and textures that can be applied to models. Most of the customization of materials depends on which shader is chosen for it, although all shaders have some common functionality.

To create a new material, start by making a Materials folder. Give your material some descriptive name and you are done. Notice how they each have a base texture, main color, tilling and offsets, and a preview of the material blank now because there is no texture.

The Shiny material, however, uses a specular shader and comes with properties for specular color and shininess. All these properties are covered later in this hour. Shaders Revisited Now that you understand textures, models, and shaders, it is time to look at how it all comes together.

Unity has a lot of built-in shaders, but this book is concerned with only a few of the Normal family of shaders. These shaders are the most basic and should be useful for everyone. Table 3. TABLE 3.

Start a new project or scene. Note that creating a new project will close and reopen the editor. Create a Textures and a Materials folder. Add a cube to the scene. Position it at 0, 1, —5.

Give it a scale of 5, 2, 1. See Figure 3. Leave the shader as Diffuse, and in the texture block click Select. Click and drag the brick wall material from the Project view onto the cube in the Scene view. Notice how the texture is stretched across the wall a little too much. With the material selected, change the value of the x tiling to be 3.

Now the wall looks much better. Position it at 0, 10, —10 and give it a rotation of 30, 0, 0. We will discuss lighting more in a later hour. You now have a textured brick wall in your scene. Summary In this hour, you learned all about models in Unity. You started by learning about how models are built with collections of vertices called meshes. Then, you discovered how to use the built-in models, import your own models, and download models from the Asset Store. You then learned about the model art workflow in Unity.

You experimented with textures, shaders, and materials. You finished by creating a textured brick wall. Using free online resources and the Unity Asset Store, you can find various art assets to put in your games. Will I need to know how to use all the built-in shaders? Many shaders are very situational. Start with the shaders covered in this chapter and learn more if a game project requires it. If there are paid art assets in the Unity Asset Store, does that mean I can sellmy own art assets?

Yes, it does. In fact, it is not limited to only art assets. If you can create high-quality assets, you can certainly sell them in the store. True or False: Because of their simple nature, squares make up meshes in models.

What file formats does Unity support for 3D models? Explain the relationship between textures, shaders, and materials. False, meshes are made up of triangles. There are several free models. Materials contain textures and shaders. Shaders dictate the properties that can be set by the material and how the material gets rendered. You will use the same mesh and texture for each model; only the shaders will be different.

Add a Materials and a Textures folder to your project. In the Inspector view, change the aniso level from 1 to 3 to increase the texture quality for curves. Click Apply.

In the Inspector view, change the texture type to Normal Map. Add four spheres to your project. Scale them each to 2, 2, 2. Spread them out by giving them positions of 2, 0, —5 , —2, 0, —5 , —2, 2, —5 , and 2, 2, —5. Create four new materials in the Materials folder. Go ahead and set their values. Click and drag each of the materials onto one of the four spheres. Notice how the light and the curvature of the spheres interact with the different shaders.

Remember that you can move about the Scene view to see the spheres at different angles. Hour 4. You learn what terrain is, how to create it, and how to sculpt it.

You also get hands on with texture painting and fine-tuning. In addition, you learn to make large, expansive, and realistic-looking terrain pieces for your games. Terrain Generation All 3D game levels exist in some form of a world. These worlds can be highly abstract or realistic. Tall mountains, far plains, or dank swamps are all examples of possible game terrain.

In Unity, terrain is a flat mesh that can be sculpted into many different shapes. It may help to think of terrain as the sand in a sandbox. You can dig into the sand or raise sections of it up. The only thing basic terrain cannot do is overlap. This means that you cannot make things like caves or overhangs. Those items have to be modeled separately. Adding Terrain to Your Project Creating a flat terrain in a scene is an easy task with some basic parameters. You will see that an object called Terrain has been added.

If you navigate around in your Scene view, you may also notice that the terrain piece is very large. In fact, the piece is much larger than we could possibly need right now. Therefore, we need to modify some of the properties of this terrain. To make this terrain more manageable, you need to change the terrain resolution. By modifying the resolution, you can change the length, width, and maximum height of your piece of terrain.

The reason the term resolution is used will become more apparent later when you learn about heightmaps. To change the resolution of the terrain piece, follow these steps: 1. Distributed systems have become more fine-grained as organizations shift from code-heavy monolithic applications to smaller, self-contained …. Skip to main content. Start your free trial.

Table of contents Product information. You might also like book 40 Algorithms Every Programmer Should Know by Imran Ahmad Learn algorithms for solving classic computer science problems with this concise guide covering everything from fundamental … book Software Engineering at Google by Titus Winters, Tom Manshreck, Hyrum Wright Today, software engineers need to know not only how to program effectively but also how to … book Building Microservices, 2nd Edition by Sam Newman Distributed systems have become more fine-grained as organizations shift from code-heavy monolithic applications to smaller, self-contained … book CSS in Depth by Keith J.



0コメント

  • 1000 / 1000