Welcome, Guest

Please login or register

TUTORIALS SUBMENU

PHOTOSHOP    FLASH    ILLUSTRATOR    BLENDER    CINEMA 4D    WEB-CODING    [SUBMIT]

Related Links

Xpresso Tutorial - Mall Doors

pages (4): 1 2 3 [4]


Section 5 -  Turning On The Switch When The Door Stops Moving
Well, do you remember what I said about the Lightspot being a Switch? Yep, we're going to need a Switcher to make the door go back to its original position. The idea is that when the door collides with the Blocker, a switch is set. If this switch is on and there is no object in area box, then the door will return. When both doors collide, the switch turns off. Thus, if the switch is off and there is no object in the area box, the door will stop. If the switch is on and there is an object in the area box the doors will be stopped (they might be just colliding with the blocker in this case). If switch is off and the object is in the area box, then the door will move in the direction of the blocker until it collides with it. This part is easy. If the Blocker collision is true, then the Switch will be turned on.

With that overly verbose explanation over, let's begin with the fun:

Firstly, drag-and-drop the Switch to XPresso. Add an On node and a Brightness node to it. The On node's function is obvious - It will be activated if the Collision is true. The Brightness is the value we'll use as the On/Off. Now, keep in mind that the Brightness works as a percentage - and we're working with real values. Thus 100% = 1 and 0% = 0. Perfect for a true/false statement.  There are many "Brightness" inputs in the Lightspot object, but we are using the one in the General tab, so always use the General > Brightness input. Make sure this is correct, as it will not work if you use the wrong one!

Now onto the juicy stuff!  Firstly, connect the On value with the Blocker Collision. This way if they collide the node will be enabled. Then, connect the Brightness with the Absolute value we have created previously for the XOR Boolean node. Since you connect an output to various inputs, there will be no problem. Just connect it's output with the Lightspot Brightness input. You should end up with something like this:

Nothing else to see here! Moving on....

Section 6 - Breaktime
By now you can appreciate how awesomely tiresome it can be to learn a programming pseudo-class and remain a dedicated artist. I have, therefore, decided to include this chapter, which has the sole purpose of getting you to relax or take a break (if you haven't had one already).    It may be a bit ridiculous, but I've been studying psychology and this is a technique that sounded interesting to me. It gives your brain a bit of relaxation, and can restore clearer thinking. So, have your break time and let's move on!

Section 7 - Making The Door Return
Just to add to the confusion a little, we are now going to create a different series of nodes.  Remember the Switch? Well, we will make a script that responds to the "True" condition by moving the right door to the left.

So, without further ado, add the Lightspot node, and insert a Brightness output. Now, add two Right Door nodes and a Math node. We're going to do the opposite of what we've done before. Create a Position.X Output in the first node and a Position.X with an On Input on the last node. Connect this On node with the Switch Brightness. Set the Math function to subtract and enter the same value in Input 2 that you used in the first Math function. Connect Input 1 to the Position.X Output of the first Right Door node, and the Output to the Position.X Input of the second door node. You should end up with a separate little node trail looking like this:

The door must stop when both the right and left doors collide. We can do this by disabling the Brightness Switch. To do this, simply insert both Right and Left Door and connect them with a Collision node. Connect the output of this Collision node with an On input in a new Switch node, and connect an absolute node with value 0 with the brightness input of the Switch. This way, when they collide, the brightness will be reduced to 0, and thus the doors will stop.    Your full, unadulterated screen in XPresso should now look like this:

Now, copy and paste all these nodes, and invert all the Right Door values to Left Door values, Right Blocks to Left Blocks, the Maths subtract to add functions, and vice-versa, thus cloning the code onto the left door.

And that is it - You're done! Congratulations! By learning these basics of XPresso you will make future projects much easier to manage. If you feel suitably enthusiastic, you should now go try new methods of getting the same door movement. There are tons of different routes. Almost anything you can imagine is possible here. Oh, and remember, if you have any feedback or further questions, you can send me an e-mail over at kaliath@-idontlikespam-uol.com.br (where -idontlikespam- is removed). See ya!

- Tutorial written by Elentor

Pages (4): <Prev 1 2 3 [4]
Automatic Translations: Translate Into French Translate Into German Translate Into Italian Translate Into Spanish Translate Into Portuguese

Last 5 User Comments

User:  sunnyboy2005 (#19923)
Date: Sun Nov 06, 2005. 04:27:55

Post #1 of 1

Very nice, clever Xpresso tutorial.

Reply to this post


--- View Entire Thread ---
Amazing Font Pack!

Featured Tutorialsmore

Spirograph Effect
Spirograph Effect
- Adobe Illustrator -
The Last Remainder
The Last Remainder
- Adobe Photoshop -
Abstract Wireframes
Abstract Wireframes
- Adobe Photoshop -
Chains & Chainlinks
Chains & Chainlinks
- Adobe Photoshop -
Membership

Username:
Password:  
Remember Me

Lost Password? || Register

Related Links



Special Options
Printer Friendly Version
Forum Threads

 Deactivate Account
Author: jerinian
Posted: Oct 02nd, 11:16am
Activity: 1 replies, 884 views
 changes....
Author: supertackyman
Posted: Sep 12th, 2:56am
Activity: 2 replies, 1048 views
Back again and with free webhosting :)
Author: ngz
Posted: Aug 14th, 3:50pm
Activity: 0 replies, 1053 views
Cartoon Crab 6 Legs Walk Run created in Blender
Author: patricia3d
Posted: Jun 19th, 12:58pm
Activity: 0 replies, 1933 views
HTML Form Post Array to PHP
Author: Space Cowboy
Posted: May 25th, 2:18pm
Activity: 0 replies, 1828 views
My blog where i create Digi Scrapbook
Author: claudya07
Posted: May 11th, 2:33pm
Activity: 0 replies, 14440 views
Blood Dripping from Letters
Author: patricia3d
Posted: Apr 05th, 3:37am
Activity: 0 replies, 2747 views
A New Designer has joined the ranks
Author: skates1
Posted: Mar 28th, 2:19pm
Activity: 2 replies, 2771 views
The hole in Photoshop
Author: Mars
Posted: Feb 13th, 9:28pm
Activity: 2 replies, 3438 views
Colour Swatch
Author: ebz7350
Posted: Jan 15th, 11:18am
Activity: 0 replies, 2354 views
 BioRUST Forums - Reply to Topic
Author: inonShozy
Posted: Jan 11th, 11:32am
Activity: 8 replies, 2498 views
 Version 2 of my portfolio site.
Author: andrewnleon
Posted: Jan 08th, 6:18am
Activity: 6 replies, 2797 views
Forum Threads

--- Site Resources ---
Total Tutorials:212
Total Downloads:    441
Total Fonts:    4673