Get User IP Address Using PHP and ActionScript 3

An Internet Protocol Address (IP Address), is a unique number assigned to every device connected to the Internet. For different reasons, it can be useful to get the user IP address, like blocking a spammer user in a chat application for example. In this tutorial, I will show you how to get and display the user’s IP address using PHP and ActionScript.


Final Result Preview

Let’s take a look at the final result we will be working towards:

Note: this SWF is just to show the interface, it won’t show the actual IP because it isn’t connected to a PHP server.

The PHP script and SWF you create in this tutorial can certainly be used together to display the user’s actual IP address.


Step 1: Brief Overview

You’ll learn how to write and use php code to retrieve data generated from the server using ActionScript 3 and then use that data in your application.


Step 2: Set Up Your Flash File

Launch Flash and create a new document. Set the stage size to 540×300px and the frame rate to 24fps.


Step 3: Interface

This is the interface we’ll use: a simple background, a button to call the function that will get the data and some TextFields to display the data obtained from the web server.

Continue to the next steps to see how it’s made.


Step 4: Background

Select the Rectangle Tool (R), create a 540px wide, 300px high rectangle and fill it with this radial gradient #424A57, #232730. Center the rectangle to fit the stage.


Step 5: Action Button

A button will be used to call the function that will read the PHP file from the web server.

Use the Oval Tool (O) to create a 64×64px #EEEEEE circle, and center it on the stage.

To create the arrow in the middle we’ll make use of the PolyStar Tool (click and hold the Rectangle Tool button and a context menu will appear where you can select the tool), with the tool selected, go to the Properties Panel and click the Options button.

Set the Number of Sides to 3 and click OK.

Create a 35×19px Triangle and using the Rectangle Tool (R) draw a 19×18px rectangle. Align them to form an arrow.

Fill the arrow with a different color, place it in the center of the circle and Break them Apart (Cmd+B) this will cut the arrow shape in the circle.

Convert the shape to a Button and name it getButton.


Step 6: TextFields

Select the Text Tool (T) and create a dynamic textfield, this is the format used in the example: DIN Bold, 70pt, #EEEEEE. Using the same tool create another field, this time it’s a static field that will display "Your IP Address:" used as feedback to the user.

Center the textfields as shown in the image:

Name the dynamic textfield ipField.


Step 7: Embed Font

You’ll probably like to use a good looking font that not every user will have, so to make sure the user sees what we want him to see, we need to embed our font.

Select your dynamic TextFields and go to the Properties panel, Character section and press the Embed… button.

A new window will come up, select the characters you want to embed (in this case numerals) and click OK.


Step 8: A Little Detail

You will notice in the Demo that the TextFields and the Button appear to have some bevel, this is a simple letterpress effect.

To give the textfields and button this look, duplicate the shapes already on stage and using the keyboard arrows move it 1px up. Change the color to #1B1E25 to complete the effect.


Step 9: PHP

PHP is a powerful scripting language that enables your application to run code on the server side, in this case we will obtain the user IP address using a script in a web server.

Open your preferred PHP editor (any text editor will do the job) and write the following lines:

< ?php //Opening Tag, tell PHP server to interpret the following lines as php code

$ip = $_SERVER['REMOTE_ADDR']; //Sets the ip variable, its value is a method that will get the user ip
echo $ip; //The echo keyword outputs the assigned string, in this case the ip variable

? > //Close tag

This code tells the server to get the visitor’s remote address (IP) and then returns the address obtained, which is stored in the $ip variable.


Step 10: Server

A PHP compatible web server is required to run the application successfully; nowadays, almost any web server supports and has installed PHP so it would be rare if yours doesn’t (except for free web hosts).

Save the PHP file as script.php and upload it to your web server, remember that we’ll call this file later using ActionScript so don’t forget the path where you uploaded it.


Step 11: ActionScript

Now it’s time for our favorite language..

Create a new ActionScript 3.0 Class and save it as Main.as in your class folder.


Step 12: Package

package
{

The package keyword allows you to organize your code into groups that can be imported by other scripts, its recommended to name them starting with a lowercase letter and use intercaps for subsequent words (for example: myClasses). It’s also common to name them using your company’s website url, so http://mycompany.com would use: com.mycompany.classesType.myClass.

In this example, we’re using a single class, so there isn’t really a need to create a classes folder, or to set a package.


Step 13: Import Directive

These are the classes we’ll need to import for our class to work, the import directive makes externally defined classes and packages available to your code.

import flash.display.Sprite;<br />import flash.net.URLLoader;<br />import flash.net.URLRequest;<br />import flash.events.Event;<br />import flash.events.MouseEvent;<br />import fl.transitions.Tween;<br />import fl.transitions.easing.Strong;

Step 14: Declare and Extend the Class

The extends keyword defines a class that is a subclass of another class. The subclass inherits all the methods, properties and functions, that way we can use them in our class.

public class Main extends Sprite
{

In this example, the Main class inherits all the methods and properties of the Sprite Class.


Step 15: Variables

We’ll make use of two variables. Add this below the class declaration:

var urlLoader:URLLoader = new URLLoader();
var tween:Tween;

urlLoader creates an instance of the URLLoader class, that will handle the load of the external PHP file, while tween declares an object that will use the Tween class for animation.


Step 16: Constructor

The constructor is a function that runs when an object is created from a class, this code is the first to execute when you make an instance of an object or runs using the Document Class.

public function Main():void
{

Step 17: Listen for Mouse Event

The following line adds a listener to the button in stage to react on a MOUSE_UP MouseEvent.

getButton.addEventListener(MouseEvent.MOUSE_UP, getIP);

Step 18: Get IP

This code executes when the button is pressed, it loads the php page we wrote earlier on the server and calls a function when the load is complete. It also handles the button animation.

private function getIP(e:MouseEvent):void
{
	urlLoader.load(new URLRequest("http://www.mywebsite.com/script.php"));
	urlLoader.addEventListener(Event.COMPLETE, showIP);

	tween = new Tween(getButton, "y", Strong.easeOut, getButton.y, 340, 1, true);
}

Step 19: Receive and Display the Data

The next function is executed when the PHP file is fully loaded. It displays the received data (the IP address that we ‘echo’-ed) using the TextFields in stage.

private function showIP(e:Event):void
{
	ipField.text = e.target.data;
	ipFieldPressed.text = e.target.data;
}

Step 20: Document Class

Go back to the FLA and in the Properties Panel > Publish section > Class field, add Main as value. This will link this class as the Document Class.


Conclusion

Now you know how to get and use the user’s IP address in your Flash movie, experiment and implement this example in your own projects!

I hope you liked this tutorial, thank you for reading!

Model and Texture a Water Tower in 3ds Max – Day 1

In this 2-day tutorial, Chris Tate will be guiding you through the process of modelling and texturing an old water tower model using 3ds Max. Whilst day 1 covers the modelling of the tower, day 2 will take you through the UVing, texturing and rendering process.

In the first part of this tutorial, the modeling and texturing process is covered in detail, starting with the creation of a proxy model inside of 3ds max. During this stage we will block out the tower structure using simple geometry and then go through the process of adding resolution and detail, creating an aged weathered look. We’ll make use of some simple poly modeling techniques as well as Max’s paint deformation tools to create the desired effect.


Video 1

Download

Note: click the ‘Monitor’ icon to view tutorial in full-screen HD.


Video 2

Download

Note: click the ‘Monitor’ icon to view tutorial in full-screen HD.


Video 3

Download

Note: click the ‘Monitor’ icon to view tutorial in full-screen HD.


Video 4

Download

Note: click the ‘Monitor’ icon to view tutorial in full-screen HD.


Video 5

Download

Note: click the ‘Monitor’ icon to view tutorial in full-screen HD.


Video 6

Download

Note: click the ‘Monitor’ icon to view tutorial in full-screen HD.


Don’t miss more CG tutorials and guides, published daily – subscribe to Cgtuts+ by RSS.

8 Tips For Creating Memorable Business Cards

“Have we met? I’m sorry that I don’t remember. I meet a lot of people at these things. When I get home, I review the business cards I collect and try to remember who everyone is.”

(pregnant pause)

“Oh…you didn’t have a card? That’s probably why I don’t remember you. Sorry…my mind isn’t what it used to be. I need all the help I can get.”

Of course, business cards matter today. In this golden age of online social networks and contact-filled cell phone, business cards still are proof you’re serious about business. They’re badges of authenticity and extensions of your brand.

Yeah, that’s a lot pressure to put on a sliver of paper. But there are some basic things you can do to make sure your cards can carry all that weight.

Pick the proper paper

Just how serious are you about business if you’re extending your brand with a card printed on something as flimsy as copy paper? The paper stock is a measure of quality. Superficial? Maybe. It’s as superficial as your wardrobe. Seriously. Spend as much effort picking your card stock as you do on your professional clothes.

Scratch that. Spend more. You will get more bang for your buck with the business cards. Barbara Wayman lists 10 mistakes you shouldn’t make on your business cards at the Duct Tape Marketing blog and going cheap is at the heart of three mistakes.

Make a big name for yourself

I’m going to sample from Chris Brogan, president of New Marketing Labs, here. Chris recommends making your name the biggest element on the card. It’s a memento of a personal interaction. This helps your new contact remember your name at a glance.

OK, this becomes hard to justify when you’re working for someone else. Your identity may become the least important thing on the card. You’re working for a brand, remember.

Consider getting your own business cards. It signals that you and I are forming a relationship, as opposed to your employer and me.

Use an image

Valerie Maltoni of Conversation Agent is a strong advocate of using a consistent image on your business card. It’s one of the five points she makes about crafting a memorable card:

“We all meet many more people than we used to. Use a visual that connects strongly to what you do. If you’re the product, consider using a photo of yourself.

This doesn’t mean your card needs to look like that of a real estate agent, unless that is your business, of course. It just helps jog memory if you have a visual aid.”

A picture draws the eye. And it will help the brain remember who you are. If the image is used in your other marketing materials – Web site, brochures, ads, signage – it will reinforce your identity. Thus logos are a logical choice. Note that Valerie’s card uses the banner image on her Web site.

I want to make a pitch for your photo. A nice, professional portrait will help me remember who you are. I don’t understand why real estate agents are the only ones who take advantage of this opportunity. It’s not a sign of vanity. It really does help me remember you.

But you should make a choice. Two images on a business card create clutter. Less will be more.

Create a tag line

A short, clever slogan will help me remember you. “A short, powerful slogan coupled with a well-designed business card act in tandem to make following up after the event a warm call instead of a cold one,” Terrence Ward says about using a tag line on the card.

Here’s where you pull out your unique selling proposition. Create a phrase that tell us who what you do. It should answer one of these questions:

  • What’s the value that you offer?
  • What problems do you solve?
  • Who benefits from your service?

Avoid industry jargon and use plain language that everyone knows. You want me to understand what you do. Yes, confusion is memorable, but you don’t want me remembering you in that way.

Choose communication channels

You probably don’t need to tell me more than your phone number and e-mail address. Who really wants your fax number? Don’t think you’re too hip for telephone calls. Your next client might not be.

What about instant message handles? Sure, if you’re easily accessible that way and don’t mind people you barely know getting in touch that way. This same criteria applies to social media platforms and new platforms like Google Wave. If you’re comfortable communicating that way, put it on the card. If your new contact is comfortable with it, they will use it.

Oh, don’t forget your website. Yes – it’s 2010. But don’t you need a physical address on it just in case someone wants to send you a press release or hand written note?

How much room is left on this card?

It’s time to make choices. “The decision on what contact information to keep should be guided by how it will be used to network, and by common sense,” writes Ward. You can’t communicate all things to all people.

One option is to put three pieces of contact info on your card: Phone number, e-mail address and a contact landing page. The contact landing page is a page especially for people looking for a way to contact you. It can include every type of address that you own and links to all your social media accounts. You can even make a vCard available just in case you meet someone who is that kind of a geek.

Consider being two-faced

No, don’t lie about who you are. But flip your card over. Look at all that white space. Just think about what else you can say there.

Or is it better to leave it blank so we can make notes on it? Singer Christine Kane is a believer in leaving room for notes:

“When there’s writing all over the card front and back, it makes it hard for people to write notes about connecting with you.”

Sometimes I like to add something I just learned or write a reminder to follow up with information. If that’s your strategy, pick a matte finish – not lacquered – so a pen can gain traction.

If you hate letting the extra space go to waste, then make sure you make the most of it. Don’t just fill the space. For example, artists and photographers should use the space to show off a sample of their work. Moo.com lets you pick up to 50 different images to put on the “other” side. Christine also suggests adding an offer for a freebie if you must be two faced.

Make it “scannable”

Despite being a part of forming business relationship, the card is too old school for many. Now people want your info in a database. One of the quickest ways to do that is to use an OCR scanner to transfer it from dead tree to cloud. Help your info get into the database by making a scannable business card.

Nancy Nally says “scannable” cards don’t use fancy fonts and keep the background plain and light so the scanner can pick up the words.

Now that I have your card…

The business card is just the start of a relationship. After you hand it to someone, follow up. Send a reminder of the meeting. No, that doesn’t mean signing them up for your newsletter or sales call. The goal is to give them a reason to remember you, not avoid you.

And here’s my card…

I’m not offering it as a promotional tool but as a way to spark some discussion. How can I improve it? And what’s on your business card?

Multitasking: Friend or Foe?

Recently, Harvard Business Review blogger David Silverman wrote a piece in defense of multitasking. Studies have shown that constant computer use, jumping back and forth between email and news sites and Facebook can lower our attention spans, decrease our productivity, and stress us out. But Silverman argues that multitasking is inevitable – as important as air.

What do you think?

I’m guilty of multitasking, but I’ll usually take the task into account. When I’m sorting through paperwork or cleaning out my email box, then I’ll often listen to a podcast or have a movie on in the background to lighten the mood. But when I’m working on something to send to a client, I know it needs my full attention (but I’ll keep my email open in case I get an update that’s relevant to that project).

Do you focus on seeing one task through to completion or do you jump around? Do you batch process? Do you juggle multiple spreadsheets, Word docs, and browser windows or try to keep your monitor as simple and streamlined as possible?

Any opinions for or against multitasking?

Chomp Out Your Own Pac Man Animation – Part 1

This 2 part tutorial is a simulated Pac Man animation as he navigates a maze and gobbles dots along the way… with ghost chasers. The tutorial will include guidelines on building the components in Photoshop or Illustrator and then integrating them into AE to animate Pac Man. This is more of a design project that incorporates many of the foundational skills associated with AE; pre-comps, transformations, layer masks, etc.


Tutorial

In this project we will explore a variety of the many capabilities After Effects provides the user. I like this project for beginners because it starts with fundamental design and animating skills and then progresses the student in his/her understanding of the After Effects application and interface.

The simple Pac Man design breaks down into three elements;

1. Pac Man – a sphere, cut in half

2. The Maze – which can be as complex or as simple as you wish

3. The Munchies – virtually any object you want Pac Man to eat

(In part 2 we will add some more elements.)

Each of these elements are easily created in Photo Shop or Illustrator. My tutorial uses Photoshop as the design tool.

The Basic Pac Man Design –

Preparing Files in Photoshop

Pac Man

1. Launch Photo Shop and open a new document

a. Use a measurement that conforms to your needs. 300×300 will do nicely

b. Use a transparent background

2. Create a sphere, about 2/3 the size of your art board, draw it as close to the middle of the layer as possible.

Using the rectangle marquee tool, select the upper or lower half of the sphere and then “CUT” that half. (It is now in the clipboard)

“PASTE” the half that you previously cut from Layer One into a new layer. You will want to rename these layers so as to better identify them when you import this document into After Effects.

You’re done with this design element. Be sure to save your document as something other than untitled. We will import this file into After Effects as a Composition in a future step.

The Basic Maze – Munchies Included

1. Open a new document in Photo Shop

  • Use an aspect ratio that conforms to your needs. I’ll be using a custom size to conform to the maze I created.
  • Use a background color to your liking

2. Use your imagination to build your maze and your munchies. Make it as simple or as complex as you wish. Keep in mind that this is the platform on which you will animate your Pac Man. Use my maze and munchies if you want.

Use a second layer to place your munchies inside the maze. (Again, name each layer for identification purposes later.) If you include your munchies with the maze, you will be forced, in After Effects, to use a layer mask to make them disappear. It’s the most time efficient method.

Hint: Use the grid view and guides to create perfectly aligned munchies.

You’re done with this design element. Be sure to save your document as something other than untitled. We will import this file into After Effects as a Composition in a future step.

Pac Man Elements In After Effects

What is offered here are basic guidelines. You may choose to ignore or expand on these to suit your own creative style.

Maze and Munchies in a Comp

1. Launch After Effects and Create a New Composition:

Your Composition should be the SAME SIZE AS YOUR MAZE. Set your Comp duration for 20 seconds. Name it something you can remember.

2. Import the files that you previously created in Photo Shop. Import all files as Compositions. That way your files come neatly bundled in folders.

3. Drag your Maze folder into the Comp Window. You should have two layers showing in the timeline; maze and munchies.

We will come back and use this comp later, but for now let’s work on the other design elements.

THE SIMPLE TWO FRAME ANIMATION: Making Pac Man Work

1. In the Project Window, Double click on your Pac Man comp. Arrange your Pac Man comp layers so that the upper half of the sphere is directly on top of the bottom half. The comp window should look much like your original Photo Shop document. If it doesn’t, simple arrange the halves of the sphere so it does.

The process of making Pac Man’s jaws work is a simple two frame rotation. It doesn’t matter which layer you begin with, but it will go faster if you complete one layer first then move to the next layer. I’ll start with the top layer.

2. Set the top layer to animate the ROTATION property by tapping the R key on the keyboard and then click on the stop watch next to the Rotation animation property. The numeric value of the rotation at this point should be 0, and the time line should now have one key frame at the start point of the layer. Copy this Key Frame.

3. In the comp window, using the anchor-point (pan-behind) tool from the tool palette, reposition the anchor point to the bottom right edge of the hemisphere.

4. Using the page down key, advance the time line marker three frames.


5. Change the rotation value in the layer to

approximately +22 degrees.

6. Using the Page Down key, advance the time line marker and change the rotation value back to 0.


7. Select all three key frames > Hold the Alt Key (Command for Mac) and click on the stop watch to enable expressions for the layer. Then from the expressions language menu, choose Properties > LoopOut(type = “cycle”, numKeyframes = 0) from the expression language arrow.

8. Repeat the above described process for the second layer,using the corresponding anchor point position and the opposite rotation value in steps 2 through 7.

You will notice my key frames do not start at the beginning of the comp.

I’ve repositioned them to start PAC MAN animating after the intro, which

we will cover in part 2.

9. Precompose these layers by selecting both layers and choosing Precompose from the Layer Menu. (Layer>Precompose) Name your pre composition appropriately. You may to need to find it later. You now have one layer of Pac Man animating. Notice the name of this Comp because this is the Comp we will move into our working Composition later. It should look like the Illustration below.

Pac Man’S Journey

We’re now ready to navigate pac man around the maze.

1. Open your maze and munchies comp … at this point in the process it should only contain two layers; a maze layer and a munchies layer. Drag your Pac Man comp into the timeline or comp window. Now you have three layers in the comp.

2. Resize and position Pac Man accordingly. I’m starting my Pac Man in the middle of the maze underneath what will eventually be my “Start Game” slate.

3. Tap the P key for the Pac Man layer. This will reveal the Position properties for the layer. Then enable Position animation for this layer by clicking on the stopwatch.

You will see a diamond show up in the layer.

4. Move the timeline marker to the 1 second mark. And Move Pac Man in the comp window to a new position; to where Pac Man should make a turn. (Hold down the shift key to move Pac Man in a straight line.)

You will notice that After Effects automatically created a new Key Frame in the layer.

5. Move your timeline marker to the 02 second position in the timeline and move Pac Man in the Comp window to a new location. In my example, below, I moved him down.

Whoa! What’s with that curved line, and Pac Man is facing the wrong way! We will fix both of those issues in a few more steps, but right now just finish navigating Pac Man through the maze to a point at which you want him to stop.

WARNING: Avoid Pac Man crossing areas already munched. We will be using a layer mask to eliminate the munchies, and crossing layer masks will “reveal” instead of “hide.”

Fixing the Bezier and Rotation Values

1. In the timeline window –

Click on the Position property label . This will select all of the position Key Frames for the Pac Man layer.

2. In the comp window –

Move the selection tool over one of the Bezier anchor points that was created during the position key changes. Tap the G key until the pen tool turns into the Convert Vortex Tool. It looks like a slightly tilted upside down V. It can also be accessed in the pen tool throw out options. Make sure all of the position Key Frames for the layer are still selected, then click on one of the bezier anchor points to covert them to linear path anchor points.

Preview the animation. Do this by clicking the RAM Preview button in the preview tab, or by tapping 0 on the numeric keypad on your keyboard.

During your preview you probably noticed that Pac Man has a tendency to speed up and slow down between Key Frames. To fix this issue we will have to access a command menu item.

Rove Across Time

Keep all of your position key frames selected … then in the command bar at the top of the After Effects Window, choose Animation > Key Frame Interpolation. Select Rove Across Time in the dialog box, and click OK.

Okay now we’re going to fix that orientation problem Pac Man has.

Fixing the Orientation (Rotation) Values

This process can be a bit arduous and requires a good measure of focus and concentration, so if you feel the need for a break … this will be a good place to take one. What we will be doing here is changing Pac Man’s orientation in the comp window. We will do this using ROTATION values. Also, we need to be zoomed into our timeline because our rotation Key Frames will only be 2 frames apart, so zoom into the timeline using the zoom slider at the bottom of the timeline window.

1. Make sure the Pac Man layer is selected, and tap the R key on your keyboard. This will reveal the rotation properties for the layer.

Then, move the timeline marker to, or as near as possible, to the first Position Key frame. (You can see Position Key Frames by holding the Shift key and tapping P on the keyboard. You can also use your key frame navigator to assist you in getting to each new position in the process. Each animated property has a Go to previous key frame arrow and Go to next key frame arrow on the far left-hand side of the timeline.)

2. Click on the Rotation value stopwatch. This will create a rotation Key Frame. Study the illustration below.

3. Move the timeline marker one frame and (You can do this by tapping the Page Down Key one time.) change the rotation value for the layer accordingly. This will create a Key Frame. Immediately copy it. Study the illustration below.

A key frame must be highlighted in order to copy it. (Control C or Command C on a Mac, or from the Command menu … Edit > Copy)

4. Move your timeline marker to, or near, the next Position Key Frame.

Paste the Rotation Key Frame you previously copied. (Control V or Command C on a Mac, or from the command menu … Edit > Paste) This maintains Pac Man’s new orientation between position key frames.


5. Move the timeline marker one frame. Change the rotation value for the layer accordingly; in my example from-90 to -180 respectively. This will create a Key Frame. Immediately copy the new Key Frame.

6. Repeat steps 4 through 5 for the rest of Pac Man’s navigation.

Start Eating

Now we’re ready to gobble some munchies. Again, this process is arduous and requires a good measure of focus and attention. Take a break here if you feel the need.

What we are going to do next is create an animated layer mask on the munchies layer of our Composition. Our mask will follow the route that we have previously mapped-out for Pac Man. Again we will be using those original Position Key Frames to assist us.

1. Select the munchies layer in the timeline window.

2. Select the Pen Tool from the tool bar. (Shortcut Key is G)

IN THE COMP WINDOW

3. Draw a box around Pac Man at his current position in the timeline.

Tap the M key on the keyboard. (This will reveal the Mask properties for the layer.)

IN THE TIMELINE

4. Click on the Mask Properties stopwatch and then click on the box next to the Inverted option.

5. Advance the timeline marker to the next Pac Man Position Key Frame.

IN THE COMP WINDOW

6. Tap the V key (selection tool) Select the leading two Mask anchor points and drag them along the path to the point where Pac Man is now located. Select the Add Vortex tool and add anchor points to the layer mask to facilitate the next change in the layer mask shape. Zoom in on the Comp Window to assist you in adding anchor points.

7. IN THE TIMELINE WINDOW

Advance Pac Man to the next Position Key Frame.

8. Repeat steps 5 through 7 for the duration of Pac Man’s journey.

FINISHING UP

Included in the project files should be an AIF file called munchie clip.aif.

1. Import the munchie clip.aif file into After effects.

2. Drag the file into the Timeline or comp window.

3. The clip only lasts 8 seconds, so if your timeline is longer than 8 seconds you will need to loop the clip.

In the Project Window

Right click on the file

Select Interpret Footage > Main (a dialog box will open)

At the bottom of the dialog box type in a value that will allow you to extend the clip the length of your timeline. In my example I need 20 seconds, so I’m going loop my audio clip 3 times, which will give me 24 seconds of audio.

4.In the Timeline Window extend the clip in the timeline by dragging it to the end of the timeline.

5. Preview the Comp by pressing the 0 key on the numeric keyboard.

CONGRATULATIONS – You’ve completed Part 1

As you discovered, this isn’t an easy project. It takes time, attention and a creative mind to complete this project in a professional manner.

Look for the second part of this tutorial, where we add some enhancements, including a Game Start Slate, Ghosts and more audio.

Hope you enjoyed working through this project. :-)


Illustrating a Chili Pepper with Illustrator’s Envelope Distort Tool


Illustrator’s Envelope Distort is an editing tool that not only creates distortions in an object or image, it can also be used for modeling interesting forms, like this pepper. Beginners will get to know Illustrator a little better by using the Blur, Envelop Distort, Gradient Mesh and Pathfinder tools in this easy to follow tutorial. Let’s get started!

Continue reading “Illustrating a Chili Pepper with Illustrator’s Envelope Distort Tool”

Workshop #81: You Make Me by Robert Stone

At Audiotuts+ we irregularly put up a reader track for workshopping and critique (find out how to submit a track). This is how it works: you upload your song, and every week or so we’ll publish one here and step away from the podium. The floor is yours to talk about the track and how the artist can fix problems in and improve upon the mix and the song.

This track has been submitted for your friendly, constructive criticism. They have put their track (and their heart and soul) in your hands to learn and get useful feedback.

  • Do you enjoy the song or track itself? Does it have potential?
  • Can the arrangement be improved?
  • How did you find the mix? What would you do differently?
  • What do you enjoy about the rhythm track? What can be done to improve it?
  • Is the choice of instruments relevant and effective for the style/song?
  • Are the lyrics (if any) effective? Does the style, arrangement and genre of the song suit them?
  • Can you suggest any specific techniques that might improve the track?
  • Do you have any other constructive feedback?

You Make Me by Robert Stone

Artist’s website: appleandstone.com

Description of the track:

This is my new sample song, “You Make Me.”

Download audio file (Youmakemesummeredit.mp3)

Terms of Use: Users can stream the track for the purposes of giving feedback but cannot download or redistribute it.

Have a listen to the track and offer your constructive criticism for this Workshop in the comments section.


Submit Your Tracks for Workshopping

Need constructive criticism on your own tracks? Submit them using this form.


How to Make the Synth Sound from Lady Gaga’s “Just Dance”

In this tutorial we are going to cover how to create Lady Gaga’s famous synth sound from “Just Dance”. Despite all the advancements in sound synthesis, sometimes the best sounds are the ones that are most simple. In fact the basis for the entire sound is one simple square wave!

I will be using FL Studio and the synth Sytrus for this tutorial but any synth that allows for an LFO to be applied to pitch and phase will work.

After following this quick tip, here is the sound you will end up with:

Download audio file (final.mp3)


Step 1: The Square

Load up your synthesizer and have your first oscillator (or operator if using an FM synth) be set to a square wave. For those of you using Sytrus just right click the waveform box and click on Square.


Step 2: Pitch Distortion

Next go to the Pitch and LFO menu (or however your synth controls LFO and pitch) and delete all but the first control point. From there set the speed to as fast as possible (may need to adjust for other synths) and move the control point up by only 3%. The move is so small that you won’t even see the LFO graph change (the % value is in the top left of FL Studio).

For other synths make sure the amount of your pitch the LFO effects is very light. The reason this is pitch distortion and not modulation is because we are changing it so fast by such a small amount it ends up sounding like a distortion. Remember it’s almost impossible to distort a square wave in the traditional sense because a pure square wave is pure distortion!

It should sound something like this:

Download audio file (step 2.mp3)


Step 3: Phase Distortion

Next go to the Phase and LFO menu and once again delete all of the control points, set your LFO speed to maximum, and move your control point to about 3%. You may not hear too much if any difference now, but it adds to the overall sound later on.

Here is my sound so far:

Download audio file (step 3.mp3)


Step 4: Starting the FXs

Next go to the matrix and send Op 1 to FX and take it off of Out since we will be using Sytrus’s onboard effects as the output. At this point just copy the picture as close as you can in the highlighted section.

For those of you who are not using Sytrus or those who want exact values, here are the values:

  • Chorus Order: 1
  • Chorus Depth: 20%
  • Chorus Speed: 45%
  • Chorus Delay: 0%
  • Chorus Spread: 100%
  • Chorus Cross: 0%
  • Chorus Volume: 0%

For the reverb, the only important values are the Decay being 2.5 seconds and the wet level only being around 3%. Tonally, make sure it is a warm reverb without too much high end.

Here is my sound:

Download audio file (step 4.mp3)


Step 5: Unison

Back in the main menu go to the Unison section and change the order to two. Make sure the panning is at 100%, the volume is at 70%, and the pitch is 30%. For those of you using outboard effects, try placing your unison before and after the chorus and reverb to see which sounds closer.

This is what my sound is like now:

Download audio file (step 5.mp3)


Step 6: More Chorus

Make sure your synth is now routed to a mixer track and add a Fruity Chorus or whatever chorus effect your prefer. If you are using the Fruity Chorus use the LightEh preset. For everyone else follow the picture as close as you can for your chorus.

Here is my sound so far:

Download audio file (step 6.mp3)


Step 7: Low Pass Filter

After the last chorus effect add now a low pass filter; I used the Fruity Filter in my patch. At this point nothing fancy needs to be done with the filter, just roll off the really high frequencies.

Remember part of Lady Gaga’s sound is here almost vinyl like quality and the removing some high frequencies helps that a lot. It should sound almost like the Just Dance synth at this point.

Here is my patch at this point:

Download audio file (step 7.mp3)


Step 8: EQing the Ring

Some of you may have noticed that the fundamental of our square wave is rather ringy. To lessen this ring, add a parametric EQ to your patch and lessen the frequencies around 400hz by about 30%; also roll a hair off the high end.

Your final sound should sound something like this:

Download audio file (step 8.mp3)


Just Dance

While we have created the sound, does it sound right in context? For all you skeptics, add the melody to your piano roll. It goes from E4-F#4-D#4-A4-F#4. While the whole melody sounds like 8th notes, you must make sure to trim off the very last bit of the note to give separation. I was using 1/4s of a Step to trim off the last 32nd Note.

Hope you all enjoyed! Remember Just Dance!

Download audio file (final.mp3)

Download the Play Pack for this tutorial (3.3 MB)

Contents

  • FL Studio Source Files


Quick Tip: Add a Frosted Background to Photo Captions


In this Quick Tip tutorial, we will demonstrate how to improve a text caption by creating a frosted glass-like text bar that can improve the look of your photos or designs.


Step 1

Open up any image in Photoshop. I used an autumn photo. You can use a similar one if you like. Otherwise, any image will do. Unlock the background layer by double clicking on the layer, call it "Leaves".


Step 2

Create a new layer (Cmd (Ctrl) + Shift + N) on top of the Leaves layer, and call it "Frosted Bar". Using the Rectangle Marquee tool (M) making sure you’re on the Frosted Bar layer, drag out a selection of the bar size that you desire, making sure it touches both sides of the document. The placement of the bar is up to you; in my case I am putting it down at the bottom of the image as shown.


Step 3

Fill in the selection using the Paint Bucket tool (G) with white (#FFFFFF) and deselect the current selection (Cmd (Ctrl) + D).


Step 4

Apply the following layer styles to the "Frosted Bar" Layer. (Blending Options: Custom – Set Fill Opacity to 20% under Advanced Blending)

Stroke: Using white (#FFFFFF) with size set to 2 and position outside and 50% opacity.


Step 5

We will need to edit our original image so it’s best to make a duplicate copy so we can always reverse it. So with the Leaves layer selected duplicate it (Cmd (Ctrl) + J). With the "copy Leaves" layer selected, load the frosted bar selection again by Cmd (Ctrl) + clicking the Frosted Bar layer icon. Apply a Gaussian Blur (Filter > Blur > Gaussian Blur) input 20 as the radius and click OK.


Step 6

With the basis of our frosted bar created, we can now apply highlights. Create a new layer (Cmd (Ctrl) + Shift + N) on top of the Frosted Bar layer, and call it "Highlights". Load the Frosted Bar selection again if you have not got it already selected, and select the Brush tool (B). Using a large soft brush (500px, no hardness and White as the colour: #FFFFFF) paint highlights in the middle of the bar, both on top and below (as seen below), finally drop the opacity down of the layer to 60%.


Step 7

Our final step is to add text. Using the Text tool (T) add whatever text you want within the bar at whatever size suits you (In our case out font size is 100px). Drop the opacity down to 40% on the text, and change the blending mode to Overlay, and that’s it.


Final Image

Take a look at the final image. Hope you enjoyed the tutorial!

Create an Adrenaline Filled Car Chase Scene


If you’ve spent much time looking through stock photography websites, you probably already know that it isn’t easy to find a perfect photo for any given project; and if there is, you will probably spend more time than its worth tracking it down. That’s why you will often need to create your own composite image to make a photo work. In today’s tutorial we are going to use many techniques to turn several stock photos into an action packed car chase scene with explosions and weapons fire.


Resources

The following images were used during the production of this tutorial.


Preparation

First we need to look at some photographs of cars in motion for reference so that our portrayal is accurate. Here, here, here and here are some good references from photographers on deviantart. If you search the internet I’m sure there are more examples to find. We will be trying to create an image like those but with things being blown up and cars being shots at.

Please note that brush sizes are not given as I usually just increase or decrease them using [ and ] respectively till I get an appropriate size rather than just using a certain size. Colours are given with a # in front of them. In terms of brushing Soft Brush usually refers to a round brush with a soft or blurry edge while a Hard Brush is referring to a round brush that has a well defined border.


Step 1

Open up Background.jpg in a new document. As you can see its quite a high resolution picture and this will enable us to work at a high resolution which has its advantages in being able to add more details and being able to print at larger sizes. On the other hand it be slower to use filters and others tools especially if your PC is slightly older and slower. Its a trade off and you have to choose how big you want to work and resize to a desired size using Image > Image Size. The rest of the tutorial is in relative to this layer so you can choose whatever size you think works best for you.


Step 2

Open up Sports Car stock in a new document. We need to isolate the car from its background. Use your preferred selection technique to select the white background of the Sports Car stock. Personally I prefer using the Pen Tool (P) to manually select the background. After selecting the background you can remove it by adding a Layer Mask to it. I prefer isolating stock in a separate document to the main file because it means you don’t have to resize the stock, because of differences in canvas size between the stock and main file, before isolating it.


Step 3

Import the Sports Car image into the file with Background.jpg. Using the Free Transform Tool (Ctrl+T) flip the car horizontally by adding – before the figure in the W: box. Then resize, move and rotate the car so that it fits into the background better, don’t worry if it isn’t perfect at this stage as well will be modify the car a lot in subsequent sets. You can see some of the numbers I used for making the car fit in the image below.

Note: Don’t be fooled by the – in front of the H: box, I had initially put the – in the W but the rotation added after changed it to a minus in the H box.


Step 4

Duplicate the Background Layer. If you look at the references in the introduction you can see the background is blurred and to achieve this we are going use Filter > Blur > Radial Blur on the duplicated layer. The settings used are shown in the image below. It is very important to get the blur center absolutely right, keep doing and undoing the Radial Blur until the center looks correct to give a good perspective on the road.


Step 5

Add a layer mask to the duplicated Background layer and using a Soft Black Brush at about 20% opacity brush into the layer mask to remove some of the blur to bring out some details from the background.


Step 6

Now we are going to go back to the Sports Car layer to make it fit better into the scene. Start by transforming it using Edit > Transform > Perspective and Edit > Transform > Skew. There is no exact method to this, just use the various transforming tools to make the perspective and proportions of the car fit into the scene.


Step 7

Now we are going to the blur the wheels of the car so they look as if they are in motion. Select the rear rims using the Pen Tool (P) and use Filter > Blur > Radial Blur. For settings have Blur Amount: 10, Blur Method: Spin and Blur Center slightly down and left of centre.

Afterwards select the front rims in the same way and apply Radial Blur but this time with Blur Amount: 50, Quality: Best and Blur Center slightly up and right of center


Step 8

Now we are going to remove the white in the car windows. Select the white areas using the Magic Wand Tool with a tolerance of 32, Shift + Left Click to add multiple areas. This will also select some of the white of the card hood. Deselect it by using the lasso tool around it while holding the Alt key. Then delete by pressing the delete key.

Erase some of the seat seen through the front window using a Soft Brush at about 20% Opacity. We will be going back to the windows at a later stage so don’t worry too much about the details.


Step 9

Now to a add to shadow to the underside of the car. Create a New Layer (Ctrl + Shift + N), name it "Soft Shadow" and drag it under the "Sports Car" layer. Start with a Soft Black Brush at 100% Opacity and brush the underside of the car using a Soft Eraser at 100% Opacity to erase any mistakes.

Add a Radial Blur Filter to the layer with Blur Amount: 50, Blur Method: Zoom, Quality: Medium and the Blur Center roughly the same as we used for the background in Step 4. Now set the layer Blending Mode to Soft Light and the Opacity to 75%. If any areas look like they need more shadow add it with a Soft Black brush at 20% Opacity.


Step 10

Create a New Layer above the "Soft Shadow" and name it "Hard Shadow." Get a Soft Blue (#00ffff) Brush and brush in the immediate underside of the car. Apply a Radial Blur to it with the same settings as the last step but with Amount: 30. Set this layer to Hard Light with Opacity 10%.


Step 11

Now to fix the lighting. Use Image > Adjustments > Brightness/Contrast with Brightness: -75 and Contrast :5. Then using Dodge and Burn tools at Range: Midtones and Exposure:20% give the car some highlight and shadows.


Step 12

Make a New Group (Cmd + G). Name it "Window" and drag it above the "Sports Car" layer. Create a New Layer in it and using a soft black brush at 70% Opacity brush in the side of the windows to make them slightly darker, this will be the shading for the windows. Then set the layer to Opacity 50% .

Create a New Layer (Cmd + Shift + N) above the previous then using a Soft Brush at 100% Opacity with # 2b1e05 brush in all the windows. Set the Blend Mode to Soft Light and Opacity to 70%.

In another new layer using a Soft Brush at 100% Opacity with # 103624 brush in all the windows like before. This time set the Blend Mode to Hard Light and Opacity to 80%.


Step 13

Lets add some reflections in the windows. Create a New Group (Cmd + G), name it reflection and drag it under the "Windows" group. Create a new layer in the new group and using the Eye Dropper Tool (I) select some coloured highlights from the background and brush them into the front windows with a Hard Round Brush at 100% Opacity.

Then do a Filter > Blur > Blur Motion to this layer with Angle : -9 and Distance: 30. Now there will be bit of ‘reflection’ on the car and background. To get rid of this we are going to select the layer below, with the # 103624 windows, by Cmd + Left Click on it and then selecting inverse with Cmd + Shift + I and deleting to remove colour outside the windows. Then change the layer to Hard Light and Opacity to 60%

Now we are going to do the same thing to the side windows on a new layer. The only difference is that the motion blur is at Angle: 5 this time.


Step 14

Lets add some motion blur to the car to give it a sense of movement. Duplicate the Sports car layer and move into a New Group called "Blur" above the "Reflection" group. While the layer is select do Layer > Layer Mask > Apply, if you isolated with a Layer Mask. This leaves the layer with just the car with no white background and no layer mask. Apply a Filter > Blur > Motion Blur to it with Angle: -9, Distance: 50.

Duplicate the layer with the motion blur. Set the original layer with the motion blur to 40% Opacity. On the duplicated layer using a Soft Eraser at 100% Opacity erase the parts of the blur which are covering the car and the repeat the Motion Blur filter by pressing Cmd + F.


Step 15

Let’s add some lights to the car. Make a new Group called "Front Lights" and drag it to the top of all the other layers. Select All (Cmd + A) and Copy Merged (Cmd + Shift + C). This is layer is not going to be part of the final image, its only use is to help get the center of the Filter > Render > Lens flare where light would leave the head lights. Click ok on the filter and check that the flare is coming from where it should be and then delete the layer.

Create a new layer and fill it with black. Go to Filter > Render > Lens Flare and this time keep the flare center the same as before but change the brightness to 40% and Lens Type to 105mm Prime. Then change the Blend Mode to Linear Dodge and Opacity to 25%. We need to illuminate the light on the cars left side as well so on the same layer do another Lens Flare but this time have the Flare Center slightly right and above the previous one and the Brightness: 20%. You can use another Copy Merged layer to get the position of the Flare Center spot on if you want.


Step 16

Create a New Layer above the previous one with the flares and using a Soft Brush with #6dcff6 and 80% Opacity brush around the two headlights. Set this layer to Hard Light with 50% Opacity.


Step 17

Using a Soft White Brush at 100% draw three lines on the near head light as seen on the image below. Then do a Radial Blur to the layer with the same Blur Center as we used for the background, Blur Quality: Medium and Blur Amount: 50. Name the layer "Head Light".


Step 18

Duplicate the "Head Light" layer. Using the Free Transform Tool (Ctrl + T) resize and rotate it like in the image below. Select both the "Head Light" Layer and the "Head Light Copy" Layer and then Right Click on them and Merge Layers. Name the merged layer "Head Light Right"


Step 19

Duplicate the "Head Light Right" layer and using the Free Transform Tool (Ctrl + T) move it and resize it so it fits well into a role as the left head light. Name this "Head Light Left". Using a Soft Eraser at 100% Opacity erase the parts of the light that would be blocked by the car. The lights are a little too bright so change both Head Light layers Opacity to 80%


Step 20

Create a New Layer above the previous one with the light and using a Soft Brush with #fff200 and 100% Opacity brush around the two headlights. Set this layer to Overlay with 10% Opacity.


Step 21

Now make a new Group called "Rear Lights" and you guessed it we are going to put the rear lights here. Duplicate the "Head Light Right" and using the Free Transform Tool (Ctrl + T) move, rotate and resize it so it fits in as the light from the rear. Duplicate this layer and rotate it and resize it again as shown below. Right click on this duplicated layer and Merge Down. Name this new layer "Head Light Rear" and change its opacity to 70%.


Step 22

Create a New Layer above "Head Light Rear" and using a Soft Brush with #fd8a8a and 100% Opacity brush around on the rear headlight.. Set this layer to Vivid Light with 25% Opacity.


Step 23

Create a New Group called "Floor". Drag it below the two head light groups. Zoom out of the image to about 50%. Using the Pen Tool (P) draw a line from outsize the bottom right corner to the where the blur center from the radial blur is.

Now to change the Brush Preset which you can find in the Brushes window, to access it you have to have the Brush Tool (B) selected. Load the Square Brushes brush set which should be one that comes as standard with Photoshop and choose the biggest square brush. Then change the settings as shown in the image below (adjust the Brush Size and Spacing to the needs of the canvas size your working on but the other settings should be the same).

When the Brush Presets have been set go to the Pen Tool (P) again and right click on the image and select Stroke path. In the next box choose Brush and tick the Stimulate Pressure box. You should now have some road lines. Move and rotate the lines with the Free Transform tool so they fit in better and then do a Radial Blur on them with the same Blur Center as for the background with 50% on Amount.

Then using the Eraser at 100% opacity erase parts of the lines to make it look like its fading in to the distance. Set the layer to Hard Light and 75% Opacity and to finish name the layer "Road Markings" so you don’t forgot what it is in the future.


Step 24

In a new layer, paint on various bright colours selected from the background using the Eyedropper Tool (I) to the side of the car and the road. Use a variety to bright colours on the car body for highlights while using mainly red on the floor. Use Cmd + F to repeat the previous Radial Blur filter to blend the colours in nicely and then set the layer to Overlay and 20% Opacity.


Step 25

Make a New Layer called "Front Light". Using a White Soft Brush of varying size and opacity as shown in the image below brush in the some more light coming from the head light. Then using a small black brush draw some black lines into the white light to give it depth. Do a Radial Blur to the layer with the same settings as before expect Blur Amount: 30 to blend it all together and then set the layer to Hard Light 15%.


Step 26

The left side of the road looks a little too bright so lets make it darker. Make a New Layer and using a Soft Black Brush at 100% Opacity brush in the areas that look a little too light. Set this layer to Overlay and 25% Opacity and using a large Soft Eraser at 25% Opacity to brush away the parts that are darker than they should be. Use your own discretion, Cmd + Z is your friend.

There is still a very light area left (pointed out above) which is from the background and we need to cover it up. Create a new layer and using some of the brown tones from the background by way of the Eyedropper Tool (I) colour in the ground with a 100% Opacity Soft Brush. Use a Soft Eraser at 20% Opacity to make it blend in with the background.


Step 27

That’s it for this car. Make a New Group called the "Leading Car" and drag all the Groups with their layers from the previous steps, expect for "Background". This is just to keep the file organized as we will still need to add a lot more elements to complete the piece. Create a New Group called Explosion and place under " Leading Car" but above "Background".


Step 28

Create a New Layer in the "Explosion" Group. We could use a stock to make the explosion but its more interesting to create our own and I feel this will fit the piece better as well even if it may not be that realistic. First select a Soft Round Brush and go into Brush Presets and give it the settings below.

Now we are going to brush in the basic shape and colour of the explosion. I have outlined below the steps that I used as well as the colours, a brush of Opacity 100% was used throughout. This part is all about trial and error, the beauty of working on a computer is you that you can use Undo. After the brushing is done apply a Zoom Radial Blur of Amount:40, with the same center as earlier. to the layer.


Step 29

Move and Free Transform the layer so that the explosion fits into the scene better, you want it to be where the horizon would be. Create a New Layer and drag it below the one with the explosion. Use a 60% Opacity Soft Brush with #f3d711 to brush under the explosion on this layer, and then reduce the brush opacity to 10% and use Black to give the yellow some shadows. Select the layer above, Right Click and Merge Below and name the layer "Boom!".


Step 30

Add a Layer Mask to the "Boom!" layer and remove the bottom part of the explosion by painting with a black brush inside the layer mask. Then Create a New Layer and Right Click on it and select Create Clipping Mask. We are to shade the explosion below in this layer so use a black brush with low opacity to add shadows and a white brush for highlights.

Then use a Hue/Saturation (Cmd + U) on the "Boom!" layer with Hue: +3 Saturation: -15 & Lightness: -3.

Use the Dodge and Burn (Midtones) tools on the layer to accentuate the shadows and highlights to give more depth. The dark spots also looked out of place so use a small eyedropped Soft Yellow Brush of 30% Opacity to hide them.


Step 31

To finish of the explosion Create a New Layer and draw a big dot around the explosion with a Soft #fff000 Brush at 100% Opacity, this will be the glow from the explosion. Erase the bottom half of the glow with a 20% Opacity Soft Eraser and set the layer to Overlay at 20%.


Step 32

Now lets add a car chasing the leading car to give the piece even more drama. Create a New Group and name it "Police". Place it above the "Explosion" Group but under the "Leading Car" one.

Open the Cop Car stock and isolate the car from background like you did for the Sports Car and similarly duplicate it into the file we are working on. Drag it into the "Police" group and use the Free Transfrom (Cmd + T) tool to resize and move it into a appropriate position for it to be in pursuit of the Sports Car. Name the layer "Cop Car"


Step 33

Let’s transform this Cop Car just like we did for the Sports Car. The tools used can be found under Edit > Transform. The steps are shown in the image below.


Step 34

Go to Image > Adjustments > Brightness/Contrast on the layer with Brightness: -12 and Contrast: -26. Then create a New Layer and add it as a Clipping Mask. In this new layer use a Soft #fff000 Brush with 30% brush in the right side of the Cop Car (your left) to show the light it would be receiving from the explosion in the background.


Step 35

Now let’s add shadows to the Cop Car just like we did for the Sports Car. Create a New Layer under the "Cop Car" layer and name it "Soft Shadow". Using a Soft Black Brush at 100% Opacity lets colour in a Shadow. When done use a Zoom Radial Blur filter on it with the same center as always with Amount: 50. Set this layer to Soft Light at 75% Opacity.


Step 36

Create a New Layer above the "Soft Shadow" and name it "Hard Shadow" just like for the Sports Car but this time use a Soft Black Brush to brush in the immediate underside. Leave the Blend Mode on just Normal this time but change the Opacity to 80%


Step 37

Create a new New Group within "Police" and name it "Lights", this new sub group needs to be above the others layer in "Police". Create a New Layer in it and name it "Head Lights". Using a White Soft Brush at 100% Opacity paint two dots that cover the two headlight/ Then reduce the opacity to 50% but increase the brush size to almost double its original size and paint on the two dots to give them a glow. Change this is layer’s Opacity to 80% to finish giving the Cop Car head lights.


Step 38

Create a New Layer above "Head Lights" and name it "Red". We are going to make the red portion of the Cop Car’s emergency light on this layer. Using a Red (#ff0000) Soft Brush at 100% Opacity paint a big red dot on left emergency light on the top of the car and the right emergency light on the grill of the car. Then reduce the Brush Opacity to 50% and brush around these two dots to give them a glow then set the layer to Overlay.


Step 39

Now Create a New Layer above "Red" and name it "Blue". Using a Blue (#0000ff) Soft Brush at 100% Opacity paint big dot like before on top of the car and the grill but on the opposite side this time. Then reduce the Brush Opacity to 30% and brush around these two dots to give them a glow but don’t make it as wide as the red glow because emergency lights often work out of phase to each other so one light will be bright on one side of the will the other will be bright on the other side of the car which we can’t see. Then set the layer to Soft Light.


Step 40

That’s it for the Cop Car. Now let’s add a gun man in the leading car shooting at the cop cops, what’s an action seen without some gunfire? Create a New Group and named it "Gunman" and place it above the "Leading Car" group.

Open the Gunman stock and isolate him from background just like you did for the two stocks previously and similarly duplicate him into the file. Drag it into the "Gunman" group and using the Free Transform (Cmd + T) tool resize and move it so it looks like the man is leaning out of the window.


Step 41

Now its time to get transforming again. You should know the drill by now; the process is shown in the images below.


Step 42

If you isolated the image with a Layer Mask go into it if not make a new one on the layer with the stock. Using a Black Brush of 80% mask the bit of the gunman that would be seen through the glass. Use a 100% opaque Brush to mask parts that would be hidden by the car.


Step 43

Use Dodge & Burn (Midtones) to shade the gunman. A little guide and side by side comparison of before and after is given below.


Step 44

Create a New Group within the "Gunman" group and name it "Bullets". Make a New Layer called "Light Trail" in it. Now we are going to paint on some gunfire coming from the gun. For this we are going to use a brush that comes as standard with Photoshop, to find in the brush selection menu choose Reset Brushes and from the selection of brushes choose the one shown below. Choose a appropriate brush size to cover the barrel of the gun and paint on top of it with 100% Opacity in White. Then use [ to decrease brush size and paint the trail of light coming from the barrel of the gun. Apply a Filter > Blur > Motion Blur to this layer with Angle: 4 and Distance: 5 to finish off the "Light Trail".


Step 45

To finish off the bullets let’s add some glow to them. Get a Soft #fff200 Round Brush at 100% and draw a big dot around with the centre where the light trail is. Reduce the brush Opacity to 50% and draw an even bigger dot on top of the one you just drew. Use a 70% Opacity Round Eraser and eraser the yellow from where the light would be obstructed by the car and set the layer to Vivid Light Opacity 30%.


Step 46

That’s it for the piece as far as adding elements are concerned. Hopefully you have learned quite a bit already. Now all we have to do is polish up the piece with a few adjustments to finish it off. Below is the image so far. Make a New Group called "Adjustments" on top of all the other groups and you guessed it we are going to put our Adjustment Layers here.


Step 47

Adjustment Layers can be reached either by Layer > New Adjustment layer or by clicking on the black/white icon in the Layers window which is shown below. Most of these adjustments are to finish the piece to my personal preference. Experiment with the adjustments settings as they have a big visual impact on the final product, I will outline what I did below.

Let’s start of off with a Levels layer. The aim of the layer is improve the contrast in the piece and the values used are shown below.

Afterwards make a Black and White Adjustment Layer with the values give in the image and set that layer to Overlay 15%.


Step 48

Now let’s add some Gradient Maps to the piece, they too can be found under Adjustment Layers. In the Box for Gradient Map click on the drop down menu and then the arrow and choose Color Harmonies 1. In this selection of gradients use the orange and blue one shown below and set layer on Color at 15% Opacity.

Now add another Gradient Map from the Color Harmonies 1 set called Red-Orange, Blue-Green. On Gradient options tick Reverse and press OK. Erase the parts of the Gradient Map that affect the more foreground elements of the piece and then set it to Soft Light 20%. This will help give the piece more depth.


Step 49

We are now going to create our penultimate layer. We are going to start this layer differently by first changing the layer blend mode Soft Light and Opacity to 30%, this is to enable us to directly see the effect this layer will have on the rest of the picture. Now use the Gradient Tool with a White to Black, Radial Gradient on 100% Opacity to make a gradient as shown in the image. The aim of this layer is to increase the attention given to the foreground elements by lighting them while darkening the background ones.


Step 50

This is will be our last layer, finally! Select All (Cmd + A), Copy Merged (Cmd + Shift + C) and Paste (Cmd +V) to get a layer with the image so far. Do a Filter > Other > High Pass with a Radius of 1.0 and set it to overlay to give the image a slight sharpen to finish it off.


Conculsion

So that’s it! See all the action we can create from just four stationary pieces of stocks. Hope it was an interesting read for you and that you have picked up some nifty tips, tricks and techniques you can use and even improve upon to great create future works.

5 Reasons To Check In With Human Resources

The Human Resources department isn’t just for resolving serious work-related conflicts – or for new employees. It’s a commonly overlooked resource for both happy and unhappy employees. It’s a shame that employees only visit HR when faced with a tense situation. After all, they are quite literally “at your service,” whether you’re in the middle of a catastrophe or enjoying a long string of productive workdays. Perhaps it’s time to visit that sleepy corner of the office to see what Human Resources can do for you.

Professional Issue Resolution

Venting to co-workers about work-related gripes can backfire quite easily. You can be misunderstood, overheard, or shunned. If you vent to your HR rep, they’re obliged to handle your problem professionally. If they’re any good, they’ll come back to you later with a proposed course of action to address whatever is bothering you. So, instead of sending your complaints into an echo chamber, send them to the people who can handle them.

Employee Wellness Programs

Have you asked your company about employee wellness programs? They come in a wide variety, but they’re meant to keep you healthy, happy and productive. The company hopes to reduce job-related injuries and absenteeism, but what do you get as an employee? Well, some employers pay for part of all of a health club membership, some offer professional stress management, some even offer cash prizes if you lose weight or quit smoking. HR wants you to be healthy, and they’re probably offering some perks to prove it.

Education Reimbursement

Employers get obvious benefits from retaining highly-trained and highly-educated employees. As a result, some will assist you in paying for programs that will advance your knowledge of skill set. Google employees receive up to $8,000 annually in tuition reimbursement. These benefits can be amazing, but they require some initiative on your part. It’s certainly not a perk to enjoy passively; you have to take the initiative to talk to them about qualifying programs.

Company Discounts

During the usual course of business, employers will naturally build relationships with other firms. Frequently, they will offer each other discounts on goods and services as a benefit to employees of both companies. Who has your company aligned with? Have they offered each other a mutual exchange of discounts? If you don’t know the answers, you might be missing out on some serious savings.

Policies

Human Resource is the forge for all employee policies. Parts of these policies impose limitations and constraints on you, but there are advantages to find as well. Does your company pay for seat upgrades on certain airlines? If you’re rarely sick, can you trade sick leave for vacation leave at a certain exchange rate?  Human Resources wants you to know the policies, but you can’t expect them to be psychics. But, if you pay them a quick visit, they might help you find some gold in that long, tedious, fine-print policy.

How do you find your HR department in terms of approachability?  Do you use them for situations like the ones mentioned above?  Can using their resources make you more productive?  Let us know in the comments.

How Do You Learn?

Idle hands are one thing, but what about an idle mind?

As human beings, we thirst for knowledge.  Heck, it’s the message behind the opening dialogue over top of every Star Trek opening – ever.  We want to know more.  We need to know more.  How we do that is up to each of us…well, once you’re out of school.

Continuing on in school and taking courses (like night classes) is one way to do it.  You can even take many classes online now (they’re the new “correspondence” courses).  Those aside, you can learn from books that you buy or borrow.  The content on the web – like blogs – can educate as well.  And while learning on the job is likely the most common (and most cost-effective) way to learn in the present day, you may not necessarily be learning what you’d like to.

So, how do you learn?  How do you like to learn?  What’s your favorite way to learn new things and advance your knowledge in others?  Let us know in the comments.

Magento for Designers: Part 5


Magento is a stunningly powerful e-commerce platform. In this miniseries, we’ll learn how to get started with the platform, getting to know the terminologies, setting up a store and all related aspects of it and finally learn how to customize it to make it our very own.

In this fifth part, we’ll be building one of the main views of our store – the product information page. Excited? Let’s get started!


The Full Series


A Quick Recap

In the last part, we laid down the framework for the theme by building the repeating portions of the theme and essentially defining the general layout of the theme.

We also took a practical look at how theming in Magento works by going through how the layout is constructed, how the blocks work and how all the different pieces of the puzzle fit in together.


What are We Building Today?

Today, we’ll build the individual product view page. Just like before, the source files, both the front end and back end, are included. You can use it to see how the page looks but outside of that, the theme should look broken since, you know, we haven’t touched the rest of the views yet. So till we build the rest, try to not venture out of our sandbox.


Goals for the Page

Our goal for this specific page is relatively simple. We want a no-nonsense page that does only the essentials. Thus, I’ve drawn up a short list of elements that I think it needs:

  • The product’s title: Fairly obvious
  • Ability to show an image of the product
  • A quick and full overview
  • Availability and price of the product and finally
  • An add to cart button to place it in the cart

That’s it. I want to keep it as simple as possible and thus opted to not over do it. Once you’ve learnt the general principles, feel free to add as many whizbang features as possible.


The Basic Look

The page basically has to look like so:


Step 1 – The HTML

We’ll first look at the HTML for the content part alone. I’m assuming you’re fairly fluent in HTML and CSS so I’ll skip to the fairly important parts.

<div id="content" class="product">
<div id="main-product-image"><img src="images/primg.gif" /></div>

<div id="product-details">
<div id="product-availability">Availability <span class="available">In stock</span></div>
<div id="product-price">Price <span>$29.00</span></div>
<a class="button" href="#">Add to cart</a>
</div>

<h1>Photoshop to HTML</h1>

<h2>Quick Overview</h2>
<p class="quick-overview">
</p>

<h2>Product Description</h2>
<div class="product-description">

</div>

First up, notice that I’ve wrapped the product image with a div to make it easier to add features in the future. Suppose you want to add a quick caption to the displayed image in the future, this way will let us add this a lot more quicker.

We have another div element holding the availability and pricing information along with the add to cart button. We’ll be sprucing it up with a little CSS3 in a bit.

The rest of the HTML is very straightforward. The title resides in a h1 section while the individual section headings take up h2. The quick overview is nested in a paragraph while the full overview takes up a div.

We can move on to the styling part now.


Step 2 – The CSS

/* Product page */

#main-product-image {
	margin: 0 20px 10px 0;
	padding: 10px;
	float: left;
	border: 1px solid #E1E1E1;
	background: #F3F3F3;
}

#product-details {
	width: 180px;
	padding: 10px;
	float: right;
	border: 1px solid #E1E1E1;
	background: #F3F3F3;
	margin: 0 0 0 20px;
}

#product-availability span.available, #product-price span {
	color: #7db000;
	float: right;
}

.button {
	margin: 10px auto;
	display: block;
	width: 140px;
	padding: 5px 10px;
	text-align: center;
	text-decoration: none;
	color: #555;
	border: 1px solid #ccc;
	font-size: 18px;
	background: #ddd;
	border-radius: 12px;
	-webkit-border-radius: 12px;
	-moz-border-radius: 12px;
	box-shadow: 1px 1px 2px rgba(0,0,0,.5);
	-webkit-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
	-moz-box-shadow: 1px 1px 2px rgba(0,0,0,.5);
	text-shadow: #fff 0px 1px 1px;
	background: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#cccccc));
	background: -moz-linear-gradient(top,  #eeeeee,  #cccccc);

	}

.button:hover {
	background: #014464;
 	background: -webkit-gradient(linear, left top, left bottom, from(#cccccc), to(#999999));
	background: -moz-linear-gradient(top,  #cccccc,  #999999);
	color: #000;
	}

.button:active {
	-moz-box-shadow: 0 2px 6px black;
	-webkit-box-shadow: 0 2px 6px black;
	}

Nothing fancy here. Very basic CSS to place the elements in position.

I’ve also used a bit of CSS3 to make the buttons a little better looking.


Step 3 – Creating our catalog.xml File

As I mentioned in the earlier part, each module gets its own XML file to dictate what items to include and the general layout of the page. The page we’re building today relies on a file called catalog.xml to define its contents and structure.

This file should be present in the layout folder so let’s create an XML file and name it catalog.

The complete file for today looks like so. I’ll explain each bit part by part below.

<?xml version="1.0"?>
<layout version="0.1.0">
    <catalog_product_view translate="label">
        <label>Catalog Product View (Any)</label>
        <!-- Mage_Catalog -->
        <reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
        </reference>
		<reference name="head">
            <action method="addCss"><stylesheet>css/product.css</stylesheet></action>
        </reference>
        <reference name="content">
            <block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">
               <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
               <block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml"/>
               <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/simple.phtml"/>
               <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>
            </block>
        </reference>
    </catalog_product_view>
</layout>

Disregard the initial XML and layout version declarations. They’re of no significance to us now.

<catalog_product_view translate="label">

First, we let the system know that we’re intending to modify the product view part of the system. This is because catalog.xml houses the layout for a number of other views and so it’s imperative that we specify which view we intend to modify.

<reference name="root">
            <action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>

Now, we tell Magento to load up the 1column.phtml file as the main master template for this view. This is because each individual view can use any predefined structure. For example, your home page could use a very complex custom structure, your product page a dual column and your search page a single column layout.

If nothing is specified, it’ll load up the default template mentioned in page.xml. Since we’re using it for everything else, this part is redundant but when you’re modifying this template for your personal use, editing the file’s name is a lot easier than adding chunks of XML to the layout file.

<reference name="head">
    <action method="addCss"><stylesheet>css/product.css</stylesheet></action>
</reference>

And now we come across one of the niftier parts of Magento. Yes, we can throw all our view specific CSS into one giant CSS file but we aren’t cavemen, are we? Cries of multiple HTTP requests aside, this method lets us streamline our CSS better.

First we acquire a reference to the head section of the file and then insert our page specific content into it. Here, I’m inserting a file called product.css which contains all the page specific CSS we looked at above.

Note that you aren’t limited to CSS. Including JS and other assets is possible too.

<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">

We now ask Magento to use a specific template for the content portion of the page

 <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
 <block type="catalog/product_view_description" name="product.description" as="description" template="catalog/product/view/description.phtml"/>
 <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/simple.phtml"/>
 <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>

This block defines all the individual blocks inside the main content block. Essentially, we use individual templates for displaying the product’s image, overview and description, availability/price and finally the add to cart functionality.

And with this, our base catalog.xml file is complete.


Step 4 – Creating our Main Template

Ok, now that we’ve specified our layout we can move on to creating the catalog/product/view.phtml file that we specified as the main template for the content section in the XML earlier.

This file is slightly different from the skeleton template we created in the last part because we’ll be adding some small things directly instead of going through the template path to avoid bloat along with a smidgen of API calls to help us.

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct();
?>

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>
        <div class="no-display">
            <input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
            <input type="hidden" name="related_product" id="related-products-field" value="" />
<div id="main-product-image"><?php echo $this->getChildHtml('media') ?></div>

<div id="product-details">
<?php echo $this->getChildHtml('product_type_data') ?>
<?php echo $this->getChildHtml('addtocart') ?>
</div>

<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>

<?php if ($_product->getShortDescription()):?>
                    <h2><?php echo $this->__('Quick Overview') ?></h2>
                    <p class="quick-overview"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></p>
<?php endif;?>

<?php echo $this->getChildHtml('description') ?>
</form>
</div>

If you take a quick look, you’ll notice that we’re making a number of getChildHtml calls to acquire that blocks content. These work just like as expected and the contents of these contents will be covered a little later below.

<?php
    $_helper = $this->helper('catalog/output');
    $_product = $this->getProduct();
?>

At the moment, we don’t need to know what this means. In layman’s terms though, we’re essentially asking Magento for this specific product’s store information so we can process it and then display it on the page.

<form action="<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form"<?php if($_product->getOptions()): ?> enctype="multipart/form-data"<?php endif; ?>>

Here we use one of Magento’s API methods to dynamically generate the URL the form needs to post to.

<h1><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></h1>

We use another of Magento’s methods to acquire the product’s title directly.

<?php if ($_product->getShortDescription()):?>
                    <h2><?php echo $this->__('Quick Overview') ?></h2>
                    <p class="quick-overview"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></p>
<?php endif;?>

And again, since the quick overview is going to be just a sentence or two, I’m opting to import it directly instead of using a template. We use the same function we used to acquire the title.


Step 5 – Creating the Templates for our Blocks

With all the main parts done, we can concentrate on the individual blocks now. Now that we’ve already dealt with this when constructing the main template, this should be a lot easier now.

We’ll tackle each in order of appearance in our code:

Product image

getChildHtml(‘media’) maps directly to catalog/product/view/media.phtml. Our file looks like so:

<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
?>

    <?php
        $_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image').'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
        echo $_helper->productAttribute($_product, $_img, 'image');
?>

Some simple PHP code. We use the helper methods to acquire the product’s image and then render it on screen.

Availability/Price

getChildHtml(‘product_type_data’) maps directly to catalog/product/view/type/simple.phtml. Our file looks like so:

<?php $_product = $this->getProduct() ?>
<div id="product-availability">Availability
<?php if($_product->isSaleable()): ?>
    <span class="available"><?php echo $this->__('In stock') ?></span>
<?php else: ?>
    <span class="unavailable"><?php echo $this->__('Out of stock') ?></span>
<?php endif; ?>
</div>
<div id="product-price">Price <span><?php echo $this->getPriceHtml($_product) ?></span></div>

We first check whether the item is available or not and then output the required HTML. Acquiring the price of the product is a simple method call away!

Add to cart

getChildHtml(‘addtocart’) maps directly to catalog/product/view/addtocart.phtml. Our file looks like so:

<?php $_product = $this->getProduct() ?>

<?php if($_product->isSaleable()): ?>
        <button title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart"><?php echo $this->__('Add to Cart') ?></button>
<?php endif; ?>

As is logical, we check whether an item is up for sale before we output the required HTML. It’s a simple button as is apparent.

Product Description

getChildHtml(‘description’) maps directly to catalog/product/view/description.phtml. Our file looks like so:

<?php $_description = $this->getProduct()->getDescription(); ?>
<?php if ($_description): ?>
        <h2>Product Description</h2>
		<div class="product-description"><?php echo $this->helper('catalog/output')->productAttribute($this->getProduct(), nl2br($_description), 'description') ?></div>
<?php endif; ?>

Similar to how we included the quick overview, we use Magento’s inbuilt methods to acquire the necessary information. We do check for the description’s existence before we render it.

In case you’re curious, I typically tend to include the description separately via templates mostly because in production templates you’ll almost always be post procession the description in some way. In those scenarios, it’s easier to split this logic off onto its own template. A quick overview, on the other hand, are usually quite small and thus are included directly.


What We’ll be Building in the Next Part

.. is completely up to you. There are quite a number of views you could design but it’s rather presumptuous of me to pick one. Thus I’m asking you, the reader, to suggest a view to cover in the next part through a comment in the comments section below. Don’t forget to tell me which one to cover next!


The Last Word

And we are done! Today, we created the first view of our custom Magento theme, the product view along with looking a how Magento lets us add page specific assets and content. Hopefully this has been useful to you and you found it interesting. Since this is a rather new topic for a lot of readers I’ll be closely watching the comments section so chime in there if you’re having any doubts.

Questions? Nice things to say? Criticisms? Hit the comments section and leave me a comment. Happy coding!

Avoiding & Correcting Linear Distortion in Buildings

In this digital photography tutorial we look at ways of avoiding and removing linear distortion in buildings. We’ll go on location to shoot a few example images, and compare the result to digitally correcting images in Photoshop.


Watch the Video


Tutorial Overview

In this digital photography tutorial we look at ways of avoiding and removing linear distortion in buildings. We start off on location shooting an old church.

We then move on to discuss linear distortion, and highlight several ways in which we can avoid it. Following our shoot we take a look at several of our images shot on different focal lengths and compare them.

We then proceed into Photoshop to experiment with correcting an image, and comparing the results to the original.

Finally we look at another image where we show how we can use the same correction techniques as a special effect to add distortion to our shots.


Tutorial Image

Here’s the image used in the tutorial, shown at a slightly higher quality:

Build a Categorized Image Gallery With XML and AS3 – Active Premium

This week’s Active Premium tutorial, exclusively available to Premium members, comes courtesy of László Bugyinszki. If you want to take your ActionScript skills to the next level, then we have an awesome tutorial for you; building a dynamic XML image gallery. No puppies were woken during the making of this tut…


This Premium Tutorial is Filled with Creative Tips

XML is a data format that’s well-suited to dynamic image galleries. It’s also really easy to process in Flash with AS3. With the help of XML and ActionScript, we’re going to create an image gallery that’s dynamic and categorized into different themes. We’re also going to learn how to use a very practical tweening class, called Tweener, to move the different theme icons and the thumbnails. In this tutorial I’m going to concentrate on the effective processing of the data retrieved from XML.


Professional and Detailed Instructions Inside

Premium members can Log in and Download! Otherwise, Join Now! Below are some sample images from this tutorial.


Active Premium Membership

We run a Premium membership system which costs $9 a month (or $22 for 3 months!) which periodically gives members access to extra tutorials, like this one! You’ll also get access to Psd Premium, Vector Premium, Audio Premium, Net Premium, Ae Premium and Cg Premium too. If you’re a Premium member, you can log in and download the tutorial. If you’re not a member, you can of course join today!

Also, don’t forget to follow @activetuts on twitter and grab the Activetuts+ RSS Feed to stay up to date with the latest tutorials and articles.