My Blog for your Knowledge

We'll make sure your website works for you...

The Road to Web designing

Art Illustrations

Do you want to look great?

12 November 2010

Create an anaglyphic 3D game in Flash

With the recent vogue for all things retro 3D, it seemed timely to create a Flash-based example. In this tutorial, Flash developer Charles Maragna shows you how to build up a scene that’s viewable in anaglyphic 3D using a standard set of red and cyan-lensed glasses.

Anaglyph 3D works by superimposing two slightly different versions of an image over each other. These different versions are then tinted, and when viewed using red/cyan glasses create the illusion of depth.

While the anaglyph process can work with some colour schemes, it works best and most consistently with black and white images. In this masterclass you will learn how to create a bitmap duplicate of an existing MovieClip, as well as how to convert it to black and white and tint it correctly for the 3D process.

Your cornerstone will be a static scene which you’ll be able to rework to your own requirements, as shown in Charles’Asteroids-style game.

In our Download Zone, you’ll find a Flash project file to work from, plus a completed project for reference.

Step 1 Open AnaglyphScene.fla. Open the Library panel (Window > Library or Cmd/Ctrl + L), and drag the MovieClip called Scene to the work area of the Scene Layer, but not into the viewable region of the Stage.

Step 2 Select the MovieClip Scene (by clicking on it once) and give it an Instance Name of ‘scene’ in the Properties panel (if this is not visible, select Window > Properties). Click Edit > Edit Selected to work inside that MovieClip, and create a new layer for the graphics (Insert > Timeline > Layer).


Step 3 In the Library panel, open the Cast folder by clicking the small triangle adjacent to it.

Add a ‘backdrop’ MovieClip. Drag it into the work area, and position it using the outline to ensure full coverage. In the Properties panel, name this MovieClip ‘backdrop’. Continue this process for all the other Cast MovieClips, giving each a unique name as you go along.


Step 4 Publishing now you would produce a blank SWF, as the content is out of view. So click Edit > Document to return to the root timeline. Click on the Code Layer, then clickWindow > Actions to bring up the ActionScript editor.

It’s now time to get coding. If you get lost, don’t worry – in the AnaglyphSceneComplete project in the Download Zone, you can find the finished code with explanatory text by each part.

We now want to create a blank bitmap so enter this script:

var bmpScene:Bitmap=new Bitmap(newBitmapData(scene.width,scene.height,true,0));

Next, a copy of the scene will be drawn to the bitmap by you entering:

bmpScene.bitmapData.draw(scene);

At this point you can add the image to the Stage by entering:

addChild(bmpScene);

Step 5 For conversion to black and white, add the code below before the code you’ve written in Step 4. This defines the red, green and blue variables.

var r:Number=0.212671;
var g:Number=0.715160;
var b:Number=0.072169;

To put those variables into an array, enter this code, which applies a filter to the scene, then transforms its colour by using the above matrix array.

var ct_matrix:Array=[];
ct_matrix=ct_matrix.concat([r,g,b,0,0]);// red
ct_matrix=ct_matrix.concat([r,g,b,0,0]);// green
ct_matrix=ct_matrix.concat([r,g,b,0,0]);// blue
ct_matrix=ct_matrix.concat([0,0,0,1,0]);// alpha
scene.filters=[new ColorMatrixFilter(ct_matrix)];


Step 6 We’ll use blend modes to create the red and cyan to work with anaglyphic 3D glasses. These work just like Photoshop’s blending modes. Add this immediately after the code from Step 5 to tint the bitmap.

var ctLeftRed:ColorTransform=new
ColorTransform(1,0,0);
var ctRightCyan:ColorTransform=new
ColorTransform(0,1,1);
bmpScene.bitmapData.draw(scene, null, ctLeftRed,
BlendMode.NORMAL);

On publishing, you’ll see that the output is tinted red. Now add this code after the above line, which will superimpose a second duplicate and tint it cyan:

bmpScene.bitmapData.draw(scene, null, ctRightCyan, BlendMode.ADD);

When you publish this, the output will be monochrome. This is because the left and right views are positioned on top of each other.

Step 7 We need to separate the left and right based on their vertical position (called ‘y’ after the axis), but first we need to know what parameters we’re working within. To find this, add this loop code between the two lines of draw code:

for (var i:String in scene) {trace(scene[i].y);}

Publish your project, and in the Output window there’ll be a list of all the cast members’ vertical positions. Make a note of the largest and smallest.


Step 8 Add in the largest and smallest vertical positions by replacing the lines from Step 7 with this:

for (var i:String in scene) {
var min:Number=-13;
var max:Number=200;

The following lines use each element’s vertical po sition in relation to the maximum and minimum values to give it a depth value, and take the depth value within the range we currently have – between 0 and 1 – scaling the value to be between how many pixels we want to offset it horizontally (between -5 to 5 pixels):

var depth:Number=(scene[i].y/(max-min));
var offset:Number=(depth-0.5)*10;

This code moves each element horizontally based on the offset value. The cyan part of the image is drawn after the update.

scene[i].x-=offset;

Finally, } can be added this at the end to complete the code structure. You now have a fully anaglyphic scene to publish.

Charles Maragna

10 November 2010

Build an iPad portfolio app

The iPad is a great device for interaction, and should you whip one out while visiting a potential client they’re sure to be impressed. Wouldn’t it be great to use the iPad to show off your work?

Creating a personal portfolio app is perfectly possible. As the iPad (like the iPhone) supports the concept of an installed web app, we can create a tailor-made website, install it onto an iPad and make it available for use even if we’re not connected to the web.

For this tutorial, you will need access to a web server on your computer, or webspace that allows you to change the MIME type for a filetype. If in doubt, contact your web host for support.

Step 1 Create your design as you would a normal website. Take into account the different dynamics associated with a touch-screen interface, and let your work do the talking – this is your portfolio, after all. The only technical consideration you should be aware of is to avoid saving HTML files in sub-folders under your Index file – HTML5’s cache doesn’t like folders for HTML files. Script files, images and cascading style sheets (CSS), however, are all fine when put in folders.


Step 2 The iPad has two different screen orientations, so you’ll need to decide which way you want your portfolio. If you want to retain visibility of the iPad status bar at the top of the screen, design for 768 x 1,004 in landscape and 1,024 x 748 in portrait or, if you’re going full-screen, design for 1,024 x 768 in landscape and 768 x 1,024 in portrait.

Step 3 There are a few interactions closely associated with the iPad and iPhone in particular, as well as the new wave of tablet devices in general. These include pinch and swipe, and are treated just like normal user events as far as scripting and the browser event model are concerned, so they’re accessible via Javascript in the same way a click or a mouseover are.

Step 4 You can set up event listeners to handle individual events using the syntax window.ontouchmove. If you’re not confident working with Javascript directly, or prefer to work through a framework such as jQuery (jquery.com), there are helpful plug-ins that allow easy access to these touch-specific events.

One such library is jQTouch (jqtouch.com), which provides access to the full range of touch-based events as well as having a convenient helper method for offline web-app caching, which suits our needs perfectly. We won’t use the helper method here, but be aware of its presence, as it can make the process more straightforward.


Step 5 If you design two versions of your site’s layout for portrait and landscape modes, you’ll need to include a crafty bit of code. You can load different CSS layouts into your pages according to the device orientation by using the following metatags at the top of your code:


(orientation:portrait)” href=”css/iPad-portrait.css”>

(orientation:landscape)” href=”css/iPad-
landscape.css”>

Step 6 To create an installable web app we need a few extra assets on top of the website itself. First of all, we’re going to want an icon that sits on the iPad’s springboard homescreen to act as the launch button for our app.

Create an icon 57 x 57 pixels and save it as a 24-bit PNG file with the filename apple-touch-icon.png. You don’t need to add rounded corners or the highlight effect as the iPad OS will do this for you (unless you specifically ask it not to through an additional metatag). Add the code below to link your iPad icon to your website:

icon.png”>


Step 7 Similarly we can have a startup screen for our app. This is entirely optional – the application will work just fine without it, but a startup screen adds a nice bit of additional polish to the final portfolio, especially if you let your potential client launch the app themselves.

Create a splashscreen image 1,004 pixels tall and 768 pixels wide. Save it as a 24-bit PNG file with the filename splashpage.png. Add the code below to your section of the website homepage to enable it as the startup image:

href=”splashpage.png”>


Step 8 We need to tell the iPad that your website can be installed as an application. This is easily done by adding another special HTML metatag to the top of each page. Add the following code inside your section to enable installation and match the viewport to the iPad’s resolution:

content=”yes” />
scalable=no, width=device-width, initial-scale=1.0,
maximum-scale=1.0”/>
style” content=”black” />

Step 9 Everything is ready to install on your iPad, but we need one final file to tell Safari on the device that the website should be treated as an offline-capable web app. This file is called the cache manifest, and it’s part of the HTML5 specification. A cache manifest tells the browser what to download a copy of, and what to bring in from the web each time the app is launched.

The file itself is plain text, and looks like the example below. Note that you must set up your web server to serve this file with a specific encoding of text/cache-manifest.

See the box above right for more information on how to do this. You need to list every file that makes up your website in the cache manifest if the web app is to function entirely offline:

CACHE MANIFEST
# Offline cache v1
article.html
# supporting files
css/styles.css
js/jQuery.js
js/jQTouch.jquery.js

# images
images/page1.png
images/page2.png
images/page3.png

You also need to link to the manifest file from the top of your pages by changing your HTML declaration to read:


Step 10 Upload all the files to your web server (or copy them to your computer’s web server folder if you’re using your local machine). Next, visit the site using your iPad and click on the + button at the bottom of the Safari interface. Click the Add to Homescreen button. Safari will download all the files listed in the cache manifest, as well as the icon and splashscreen, and install a button on your homescreen using the icon you created.


Step 11 Choose the Settings application from your homescreen and either enable Airplane Mode (if you have a Wi-Fi + 3G iPad) or turn off Wi-Fi (if you have a Wi-Fi-only model). This prevents iPad from accessing the internet, and tests the offline nature of your web app. Return to the homescreen and launch your app by pressing on its icon. You should be able to navigate around your portfolio without internet access. Now, go off
and wow some potential clients.

Sam Hampton-Smith

14 October 2010

Master the basics: Perspective drawing in Illustrator

Illustrator CS5 now has a set of tools for perspective drawing. A system of 2D drawing that has its origins in the 15th century, its language comes from engineering and architecture. Unlike Illustrator’s Extrude & Bevel, Revolve and Rotate tools, it is not in the strictest sense of the term 3D.

This tutorial explores how to set up a perspective grid, draw directly on to the grid, then map existing artwork in a perspective plane. Beyond the creation of visuals, perspective drawing can lead to new ways to develop logos and icons that play on the ambiguity of 2D space.

Previously, using 2D artwork to make 3D visuals had been a convoluted process that required CAD skills and extra software. Let’s take a look at what Illustrator can do now.

1. Arrange Your Workspace Let’s start this tutorial by creating a new blank document. So, File > New and in the New Document window choose Print from the New Document Profile menu and A4, in landscape, will work well. Next set the Workspace; chose Window > Workspace > Essentials, here the Palettes have been expanded. Then from View > Perspective Grid, chose Show Grid.


2. Set Your Grid The menu various options found under Perspective Grid allow us to Define Grid…, you may find you visit here just to change the opacity of the grid. Rather than key in parameters here, we’ll use the Perspective Grid Tool to set the grid. Though do note the option to save customised grids for future use, if you so wish.

3. Perspective Grid Tool Students of technical drawing will understand One Point, Two Point and Three Point Perspective. We’ll stick with the default of Two Point. Configure this grid using the Perspective Grid Tool. This is in the Tools panel. Hovering the cursor will cause the Tool labels to appear. Use Tearoff, so Perspective Grid and the Perspective Selection Tool become a floating palette.

4. Changing Perspective The default perspective won’t suit our needs. Let’s change it. Make sure you have Perspective Grid Tool selected. Note a lot of handles have appeared all over the Perspective Grid. If you click and drag a few handles you’ll see what they do. The Horizon line is the higher of the two lines with diamonds at the end, move this upward.


5. Adjusting the Vanishing Points Zoom out so there’s space around the document. This is needed to set a reasonable perspective. The Horizon Line has two circular handles. Click–drag these outwards to make the grid look more box-like. The second, lower line with diamond handles is used to position the grid on the art board. The down facing target–like handle will move the Ground Level.

6. Scaling The Grid Here we’ve zoomed in to take a closer look at the grid. On the right of the art board are three handles. The uppermost of these controls the Grid Cell Size. Adjusting this will help drawn elements to Snap To Grid, though there maybe times when you need to position freely. Perspective Grid has its own Snap to Grid option.

7. Drawing In Perspective By default in the upper left hand corner of the screen is the Active Plane Widget. Draw a rectangle then select the Perspective Selection Tool. Use the Perspective Selection Tool to reshape the rectangle, note how the rectangle conforms to the one plane of the Perspective Grid. Hover your cursor over the Active Plane Widget, make an alternative plane active.


8. Changing Planes Keyboard shortcuts now come in handy. Select the Rectangle Tool. Its icon looks different. It has arrows indicating on which plane a shape will be drawn. 1 is Left Grid, 2 is Horizontal Grid, 3 Right Grid and 4 allows you to draw without conforming to a grid. Toggle through these options, draw a top and side to complete your box.

9. Plane Moving Switching on Smart Guides (View > Smart Guides) will help you select an origin for each Rectangle, and using the Perspective Selection Tool will help you refine your drawing. If you want to slide an object forward or back on its plane, as illustrated, hold down the 5 key whilst using the Perspective Selection Tool.

10. Adding A Symbol You can map any Illustrator artwork into a Perspective Grid, though converting it into a Symbol will help you isolate that artwork as and when you need to modify it. For now let’s use a default Symbol. Drag a Symbol from its palette onto the Artboard. With the Right Grid and Perspective Selection Tool selected position and scale the Symbol.


11. Adding text Use the Text Tool to key in some text, then use the Perspective Selection Tool to conform it to the Right Grid. The text appears to have automatically outlined itself, but it hasn’t. When double-clicking on the text, Illustrator uses Isolation Mode to allow you to adjust all parameters for the text.

12. Limitations If you now decide to modify the grid, such as move the vanishing points, then any symbols or text you’ve used would become outlined. You can set different perspective grids on multiple artboards, but again doing this will outline symbols and fonts on the first grids you made. This may not be an issue for you.

13. Pattern problems Patterns are a challenge for perspective drawing. If you fill a shape with a pattern, it will not conform to the perspective grid. Workarounds could include rasterising the pattern in Photoshop or trying Illustrator’s Envelope Distortion – though the latter option makes for a heavily compromised look.


14. Finishing touches Illustrator’s perspective drawing is not 3D modelling. As such, there are no lighting effects. Instead, try adding a gradient fill to one side of the box. Here, the Convert Direction Point tool has been used to bend the box lid for added authenticity and a shadowy blue fill under the lid suggests a flap.


Mark Wood

12 October 2010

Remix your art with Photoshop and Illustrator

Fairytale Asylum is a collaboration that has been waiting to happen since artists Stephen Chan and Andriana Katsiki (AKA Wundercloud) met in 2007. They instantly loved each other’s work and soon realised that they share a lot of the same inspirations, even though their styles are quite different.

Eventually they decided to properly join forces and start experimenting by combining their styles into something new and unique. Both love working with characters, especially ones that have some weird or twisted aspects to their personalities, and that became one of the main themes in their collaborations.

”When creating a new piece, we give the freedom to each other to express themselves how they like,” says Andriana. “The harmony of a finished piece comes naturally from the love and respect we have for each other’s work.”

The piece that Andriana and Stephen have created is a journey into the world of Fairytale Asylum – where characters live, play and kill together. They hope you enjoy the trip.

Step 1 Andriana began by first selecting an image from her personal library of characters, from which all of the Fairytale Asylum project’s illustrations will take inspiration from.

“The image I chose is from a series of anthropomorphic characters that combine fashion photography with surreal animal heads,” she says.

To begin the project, Andriana cut out the image in Photoshop and placed it on a background colour of #a3948d.

Step 2 Andriana started to build up the character by doing a colour correction pass using Hue/Saturation. She shifted the skintones down to an unnatural blue colour as the artist wanted to accentuate the dynamic pose of the character. These colours further added to the surreal, almost otherworldly feel of it. A slight gradient fill introduced more depth to the image.

Step 3 Andriana began to introduce some hand-drawn elements. She printed out the character at around 15-20% opacity and began sketching over the top. She hand-draws a lot of elements in her work, using them to extend other parts of the image in organic ways – in this case, the photography.


Step 4 Once she was happy with the sketches, Andriana scanned the image back into Photoshop and, using Levels, she removed the guide character, leaving just the drawing. She then cleaned them up and placed them over the original image.

Step 5 She then added some geometric shapes into the composition to contrast with the sketched elements. Stephen could use these additional shapes as starting points for his own illustrations. At this stage, Andriana looked at the image as it stood and, after a few tweaks to the composition, she passed it over to Stephen to start experimenting.

Her fellow artist wasted no time putting his own mark on the work.Stephen roughly established a way of working having collaborated on a few illustrations before (one of them would find a nice photo and add some graphical elements before passing it to the next person). Stephen opened up the file and saw the imagery, the strange pose of the model and the sketches – and loved it.


Step 6 “Everything in the piece was great, but I just wasn’t too happy with the composition, the positioning of the main focal point,” says Stephen.

He moved things round until they seemed right, and making adjustments to the composition after a few quick emails with Andriana. Stephen ended up duplicating the model for more impact.


Step 7 Stephen started with his usual technique for approaching a piece of work – stared at it for about half a day until something suddenly sparked in his brain. He decided to amputate the leg, firstly masking off the section in Photoshop, and then saving a low-resolution version to take in to Adobe Illustrator. “Cutting off limbs is all the rage,” he quips.

Step 8 With Stephen being quite heavily influenced by surreal and weird artists, Manga and Asian culture, massive worm creatures spewing from the thigh seemed quite perfect. He quickly vectored up some new worms and found some old worms, then quite conveniently copied and pasted them in to Photoshop.

Step 9 When Andriana received the work back, she had to spend a lot of time considering her next move, as Stephen’s duplication of the central figure had changed the dynamic of the artwork a lot.

“I really liked how it gave a completely fresh feel to the piece, so it inspired me to think about the story that was forming between these characters. My challenge now was to develop the relationship between the new elements and continue to build the story.”


Step 10 Stephen received the piece back, with a few elements moved and a texture background added. The pink circle that was at the top was now at the bottom. The heavy shape at the bottom seemed like it wanted to drag itself off the page, which lead him to create the drippy character (even the slightest change in composition can spark off inspiration).

Step 11 Stephen wanted to blend the photographic elements and the vectors a little more, and after staring at the drippy character for a while, it lead to the creation of the melting leg. He drew it up in Illustrator again, using a bright colour, which he found helps when tracing or drawing on top of dark objects. This could easily have been done in Photoshop, too.

Step 12 “The illustration is now starting to near completion, needing just a few more elements to tighten it,” says Stephen. ”Looking around again I thought maybe an image of a diamond being grasped on to by those claws (in the middle of the diamond shapes) would be fitting. And no illustration would be finished without my axe-wielding little girl.”

Step 13 Andriana’s response to Stephen’s work was, “Wow! The new characters and vectors really begin to make the piece look solid now, and I was inspired to do some more drawing. I feel like the little narrative had developed nicely, and my new drawings would pull the whole thing together.”

Step 14 Andriana then toned down the illustration, taking out the pinks so that the other elements were stronger, and so it wasn’t too busy. She and Stephen decided the composition was looking a little dull, so bringing back some of the pink would draw the viewer in to the piece nicely. This finished the piece to both artists’ satisfaction.

“There were some compromises to be had along the way,” says Andriana, “with tweaks to the composition and individual elements being sent back and forth. But in the end the overall look was achieved by working close together, and fine-tuning the composition until we were both happy.”


Stephen Chan and Andriana Katsiki



Apply to be a Chitika Publisher!
Follow on Buzz