Tuesday 21 April 2009

?????

Hi Nick

Have you read our last posts???
Can you please let us know ASAP if you have any ideas as we are submitting tomorrow....

Thanks

Mark, Richard, Whiskers

Friday 17 April 2009

rotate view script

hi nick

also, by any chance would you know a script which could be used to change the screen view.  what we want to do is rotate the view for 4 different states in isometric mode....

if you have any ideas let us know

thanks

mark, richard, felix

changing the colour of an object

hi nick

would you know of a script to change the colour of an object, using if statements.  At the minute we are using, for example:

if((sensorInput.sensor3>=348)&&(sensorInput.sensor2>=348))


{

pCube13.setAttr "blinn2.color" -type double3 1 0 0;

}


all we want to do is change the colour to say RED when the sensor readings are over these values, and from this we can adjust to the rest of our script.


Please let us know asap


Thanks


Mark, Richard, Catman

Friday 10 April 2009

If expression for multiple objects

Nick,

Hope the Easter holidays are going well.

We are having problems with connecting the If statements to multiple object output. An example (in the long run) we are trying to achieve is that if sensor A < X then translateX, if sensor A >X but < Y then translate Z, and if sensorA >Y then translate Y. Though we are having trouble connecting just even one statement. Here is the script we have complied together:

int $num = 30;
float $multi = 10;
float $zFactor = 2;

for($j=1; $j<=$num; $j++) {float $xMove = sin($j); float $yMove = ($j*.5); string $name = ("plane_"+$j); string $expressM = ($name+".translateZ=sensorInput.sensor1*" + ($j*10)); string $expressR = ($name+".rotateZ=sensorInput.sensor2*" + (sin($j)*5)); string $expressIf = (if (sensorInput.sensor3 >0.6)\r\n{$name+".translateX =sensorInput.sensor3*" + ($j*2)});
polyCube -n $name -ch on -o on -w $j -h $j -d 0.3;
move -a ($xMove*$multi) ($yMove*$multi) ($j*$zFactor) $name;

expression -s $expressM -o plane_1 -ae 1 -uc all;
expression -s $expressR -o plane_1 -ae 1 -uc all;
expression -e -s $expressIf -o plane_1 -ae 1 -uc all;
}

We have tried other ways of putting "if" statements into the seperate expressions that are created but again it doesnt work. I think this might be the closest way following the script editor and placing certain texts in the expression edittor. But I am thinking the problem is in this part of the code -string $expressIf = (if (sensorInput.sensor3 >0.6)\r\n{$name+".translateX =sensorInput.sensor3*" + ($j*2)}); - but I just don't know where.

Any help from anyone would be great fun! :)

Enjoy the rest of the "holidays"
OONAGH
spoons2101@hotmail.com

Monday 6 April 2009

The Submission

Hi everyone,

Hope the break is going well. As a reminder, below is an outline for the course submission. Each team member needs to hand in their own submission.


A4 document

-photos detailing the development of of the interface controllers
-drawings/diagrams explaining the relationship between the interface and the digital model
-renders from the animation


CD/DVD

-original maya files
-all developmental animations produced
-final animation
-pdf of A4 document
-all image files documenting the device

increasing value

Here is the example for testing the sensor input if it is increasing or not.

DOWNLOAD

Friday 3 April 2009

files to be sent....

Hi Nick

Before we broke up for easter you said that you would send us a few scripts for our project; to remind you:


The "if" statement script which allows us to create a value that will not reduce in number even when the sensor input is lower than that value.  This is so that we can move the sensors across a lofted surface creating multiple permanent depressions which stay in place when the sensor is moved.  I think we discussed this as putting a STOP to the sensor value, or to hold it so that it cant reduce in value.


If there is any confusion in how I have described this, please let me know, or email me at marksteedman64@hotmail.com

thanks

Mark   

Wednesday 18 March 2009

If Statements

Hi Nick

We are having problems with 'if' statements.  What we want to do is set up an expression which will determine the positioning of an object in relation to the range of values which we have set.  For example, if (sensorvalue) is less than or equal to x, AND more than or equal to y THEN position the object at position z.

Here are the expressions we have tried which aren't working!:

1.

if ((sensorInput.sensor3<=300)&&(sensorInput.sensor3>=250))
{
select -r pCube1;
move -r 50 0 0;
}

2.

if ((sensorInput.sensor3<=300)&&(sensorInput.sensor3>=250))
{
pCube1.translateY = 50
}



Any ideas?

Thanks

Mark

Wednesday 11 March 2009

script from today

for($i=0;$i<=20;$i++)
{
polySphere -ch on -o on -r $i ;
}

///////////////////////////////////
//change the number it counts by
for($i=0;$i<=20;$i+=2)
{
polySphere -ch on -o on -r $i ;
}

///////////////////////////////////
//count backwards
for($i=20;$i>=0;$i-=1)
{
polySphere -n ("ball_"+$i) -ch on -o on -r $i ;
move -a $i 0 0 ("ball_"+$i);
}
////////////////////////
///////////////////////////////////
//using names
for($i=0;$i<=20;$i++)
{
polySphere -n ("ball_"+$i) -ch on -o on -r $i ;
move -a $i 0 0 ("ball_"+$i);
}
///////////////////////////////////
//adding multiplier
for($i=0;$i<=20;$i++)
{
polySphere -n ("ball_"+$i) -ch on -o on -r $i ;
move -a ($i*5) 0 0 ("ball_"+$i);
}

///////////////////////////////////
//move scale rotate
for($i=0;$i<=20;$i++)
{
string $name = ("ball_"+$i);
polySphere -n $name-ch on -o on -r $i ;
move -a 0 ($i*5) 0 $name;
rotate -a 0 ($i*10) 0 $name;
scale -a 1 1 ($i*3) $name;
}
///////////////////////////////////
//move scale rotate make more
for($i=0;$i<=200;$i++)
{
string $name = ("ball_"+$i);
polySphere -n $name-ch on -o on -r $i ;
move -a 0 ($i*5) 0 $name;
rotate -a 0 ($i*10) 0 $name;
scale -a 1 1 ($i*0.01) $name;
}

///////////////////////////////////
//move scale rotate make more with variables
int $total = 200;
float $moveFactor = 5;
float $rotateFactor = 10;
float $scaleFactor = 0.01;
for($i=0;$i<=$total;$i++)
{
string $name = ("ball_"+$i);
polySphere -n $name-ch on -o on -r $i ;
move -a 0 ($i*$moveFactor) 0 $name;
rotate -a 0 ($i*$rotateFactor) 0 $name;
scale -a 1 1 ($i*$scaleFactor) $name;
}
///////////////////////////////////////////////
//2d sin curve
int $totalBoxes = 300;
float $sinMultiply = 5;
float $zFactor = 1.2;
for($x=1;$x<=$totalBoxes;$x++)
{
float $xMove = sin($x);
string $whateverYouWant = ("box_"+$x);
polyCube -n $whateverYouWant;
move -a ($xMove*$sinMultiply) 0 ($x*$zFactor) $whateverYouWant;
}
///////////////////////////////////////////////
//3d sin curve
int $totalBoxes = 300;
float $sinMultiply = 5;
float $zFactor = 2;
for($x=1;$x<=$totalBoxes;$x++)
{
float $xMove = sin($x);
string $whateverYouWant = ("box_"+$x);
polyCube -n $whateverYouWant;
move -a ($xMove*$sinMultiply) ($xMove*$sinMultiply) ($x*$zFactor) $whateverYouWant;
}

//////////////////////////////////////////////////
//connect to input
int $totalBoxes = 30;
float $zFactor = 1.2;
for($x=1;$x<=$totalBoxes;$x++)
{
string $whateverYouWant = ("box_"+$x);
string $expText = ("box_"+$x+".translateY = sensorInput.sensor1*"+($x*10));
polyCube -n $whateverYouWant;
move -a 0 0 ($x*$zFactor) $whateverYouWant;

expression -s $expText -o box_1 -ae 1 -uc all ;
}
/////////////////////////////////////
//connect to input expression different
int $totalBoxes = 30;
float $zFactor = 1.2;
for($x=1;$x<=$totalBoxes;$x++)
{
string $whateverYouWant = ("box_"+$x);
string $expText = ($whateverYouWant+".translateY = sensorInput.sensor1*"+($x*10));
polyCube -n $whateverYouWant;
move -a 0 0 ($x*$zFactor) $whateverYouWant;

expression -s $expText -o box_1 -ae 1 -uc all ;
}
/////////////////////////////////////
//connect to input expression sinWave
int $totalBoxes = 30;
float $zFactor = 1.2;
for($x=1;$x<=$totalBoxes;$x++)
{
float $sinWave = sin($x);
string $whateverYouWant = ("box_"+$x);
string $expText = ($whateverYouWant+".translateY = sensorInput.sensor1*"+($sinWave*10));
polyCube -n $whateverYouWant;
move -a 0 0 ($x*$zFactor) $whateverYouWant;

expression -s $expText -o box_1 -ae 1 -uc all ;
}
/////////////////////////////////////
//connect to input expression sinWave increasing
int $totalBoxes = 200;
float $zFactor = 1.2;
for($x=1;$x<=$totalBoxes;$x++)
{
float $sinWave = sin($x);
string $whateverYouWant = ("box_"+$x);
string $expText = ($whateverYouWant+".translateY = sensorInput.sensor1*"+($sinWave*$x));
polyCube -n $whateverYouWant;
move -a 0 0 ($x*$zFactor) $whateverYouWant;

expression -s $expText -o box_1 -ae 1 -uc all ;
}

Thursday 5 March 2009

Problem with ''Add attribute''

Hi Nick

I have a problem with adding an attribute to an object in Maya. Unfortunately it doesn’t deem to work for me.
What I do is: click on the object / from properties – add attribute – name-- leave it on the float option / ok

Then I manually change a property for example ‘’rotation’’ or ‘’x-y-z translation’’.

Then from the script editor I copy and paste the commands as you advised.

When I try to test it does not work.

Why do you think this happens? Is it something I do wrong? I remember yesterday you have tried as well on my pc and it did not work either.

Any advise please?

Many thanks

Maria

Wednesday 18 February 2009

screen recording software

As you get simple setups to work it is important that you start to document the results. The easiest way is by using a screen recorder to capture what is happening. A useful and free one is

Jing

Smooth Value from distance sensor

If you are using on of the Sharp distance sensors and are getting values that jump around there are 2 things you can do to smooth them out:

1: make sure you are running them from 5V

2: connect a 10uf capacitor between the positive and negative of the sensor.

You can get them at Maplin for £0.12.

LINK

Part num: VH06G or VH07H


If it is still not stable enough - it can also be smoothed in the software.

Monday 16 February 2009

Vista - security fix

I finally had a chance to test this on a computer running Vista today and... It works.

This will correct the problem of "mel is not a registered protocol"

-Download the file from the link below
LINK
-double-click the file registerMel.reg
-say OK to all the security warnings

Then restart firefox- and follow the directions

HERE

Sunday 15 February 2009

Sensor Resources

Unfortunately, sensors tend to be a bit more expensive in England than other places, but they are at least quite easy to get.
One very comprehensive website is: Active Robots
It is the easiest to utilize when you are trying out new sensors as you can get them quite quickly.

The website doesn't link to specific products, but i can give you the page/model numbers.


Here are a few to get you started, but if you are looking for something in particular, just post it.

Distance Sensors: gives the distance to an object within a set range.

LINK


Sharp GP2D12 - measures between 10 - 80 cm £9.99
Sharp GP2D120 - measures between 4 -30 cm £9.99



Touch / Bending / Force
LINK


These sensors either measure the amount of bending or the position of your finger (or an object) along a strip or the amount of force being applied to it.

bending



Flex Sensor 4.5" £8.81
measure the amount of bend on the sensor.




Force Sensor: measures the amount of pressure applied to the end
£11.39





linear potentiometer - returns the position along its length
£8.87 - £17.63 depending on length



rotary potentiometer - measures position around the circle (basically an IPOD touch wheel) £10.05

LINE TRACKER - reads the darkness/lightness of the colour below it to tell you which side of a line you are on. Can be used to input drawings as control mechnisms. LINK



Single Line Detector - £11.00


Triple Line Detector - £18.50




Assignment 1

OK,

So after a bit more research I have found a solution to the "mel is not a registered protocol" problem with Vista. I have to do a few more tests to be completely sure, but it seems to work. In the mean time I'm also going to bring in Maya 7.0 which fixes this problem as it handles it a different way, and we should also be able to use some of the computers in the Lab.

Regardless, Wednesday's session will be mostly working time with me helping/answering questions so it is important that each of you bring materials/hardware to work with.


Assignment 1: splines

For your first device/animation you need to construct a device which will control the shape of a curve (or series of curves). These curves should then be used to construct surfaces/forms that are animated over time. It is important to develop the relationship between the physical object and your digital one so that you are creating a device which is highly specific to your form/setup. You should also look at how you can utilize the "material intelligence" of the object to control the digital forms.

Friday 13 February 2009

PROBLEM

hi nick

I am having problems connecting to maya through the arduino/maya web browser window. It recognises the board and sensors, but once I click 'connect to maya', the error message pops up and crashes my computer.

I think this may have something to do with the fact that I had to configure my arduino to a different port. I then changed the txt file of the serproxy so that it would work, but cant remember if there was anything else that needs to be adjusted in maya.

Please let me know if you have any ideas

thanks

Mark

Tuesday 10 February 2009

power supplies

As you add more sensors, you may run into the problem of getting the error

"USB OVERCURRENT" This is because if you are powering the sensors from your USB port and it doensnt's allow very much current before throwing up the warning.

The fix is quite simple though: add an external power supply.

Anything between 5-9V should work.

You can get them at Maplin for about £19 LINK

Or you can order one from farnell for about £5 LINK
(I prefer the cheaper one, and the shipping is free and generally is next day)



Session 3


As I mentioned last time, during tomorrow's session we will begin to work with sensors to control splines. The goal is that you develop an interface that can effectively control the splines and the resulting surfaces/forms.

This will serve as the first formal assignment for the course and it is important that you bring materials with you to work in class.


As a general rule each team should have the following so you don't waste too much time:

-sensors (there are a HUGE range of possibilities and I'll post a list of links), can be anything to start with, but just have something.

If you don't have a clear idea what to use yet, I would suggest either starting with a few:

10K Lin miniature potentiometers £0.76: http://www.maplin.co.uk/Module.aspx?ModuleNo=2203
Code:
JM71N


or



10K Lin Standard Potentiometers £1.32: http://www.maplin.co.uk/Module.aspx?ModuleNo=2205
Code:
FW02C






Or you could use an LDR (light sensor)

LDR £1.39: http://www.maplin.co.uk/Module.aspx?ModuleNo=35963
you will also need a 100k resistor per ldr: £0.15: M100k



or
10K slide potentiometer £ 0.69: http://www.maplin.co.uk/Module.aspx?ModuleNo=2215
Code: JM85G



Whatever you choose, please be sure to get at least 3-4 because you will need the multiple inputs.


-Basic Materials

1. Solid Core Wire: Available at Maplin, labelled "Bell Wire". don't get stranded/braided wire because its a huge pain to use with the arduino/breadboard.

2. Wire cutters

3. Automatic Wire strippers. Not absolutely necessary, but they make your life much easier.
also from Maplin: http://www.maplin.co.uk/Module.aspx?ModuleNo=45237



Security Setup for browser

Hi everyone, below are the steps to take to set up your browser to feed maya the data. Sorry I didn't get it all sorted last time, but the way firefox 3.0 handles it is a bit different.

The basic steps are:

1. Open Maya
2. Ensure that you have the browser plugin installed for firefox:
Look in C:/Program Files/Mozilla Firefox/plugins

there should be a plugin in this folder called:
npmcpplugin.dll

If not copy to the folder from:

C:\Program Files\Autodesk\Maya2009\ExternalWebBrowser\Windows
then close firefox and reopen it.

3. Open the webpage from THIS LINK



This will bring up a "Maya Security Dialog" Box






A "polySphere" should be created in Maya



Note:
Sometimes (especially if you are on Vista) you will get the error:
mel is not a registered protocol

If you have this problem, don't worry, it can be sorted through the registry. (ie. we'll fix it in class)




Tuesday 3 February 2009

First Files

Hi everyone,

HERE are the basic connector/example files I went over last session. As i mentioned, we will be starting work tomorrow during class, so it is important that you have figured out who you are working with and that you bring some basic materials.

see you tomorrow