Thursday, June 16, 2011

Addition : Light Switch Code - Secondlifelivelyscripts

General Info About Prims

  • Prim size 10m or smaller than 0.010m.
  • Linking Distance within 3.5m of attach point.

  • Linked Object Limit 254m

  • Physical object limit 31

Google Code

http://code.google.com/p/secondlifelivelyscripts/

Code in Three Parts

Light Switch Code – 3 Parts

Part 1: Rotor – put this code on the rotor

myon_state()

{

rotation rot = llGetRot();

vector vrot = llRot2Euler(rot);

vrot+=<-30*DEG_TO_RAD,0,0>;

rot=llEuler2Rot(vrot);

llSetRot(rot);

}

myoff_state()

{

rotation rot = llGetRot();

vector vrot = llRot2Euler(rot);

vrot+=<30*DEG_TO_RAD,0,0>;

rot=llEuler2Rot(vrot);

llSetRot(rot);

}

default

{

state_entry()

{

myoff_state();

}

link_message(integer sender_num, integer num, string str, key id)

{

if(str=="stop")

{

myoff_state();

}

if(str=="start")

{

myon_state();

}

}

}

Part 2: Switch Panel (Root Prim) -
Put on the switch Panel

integer myswitch;

default

{

state_entry()

{

myswitch=FALSE;

llSetText("Light Switch", <1.0, 1.0, 1.0>, 1.0);

}

touch_start(integer total_number)

{

if(myswitch==FALSE)

{

//Turn Light Bulb ON

llMessageLinked(LINK_ALL_CHILDREN, 0, "start", NULL_KEY);

myswitch=TRUE;

}

else

{

//Turn Light Bulb Off

llMessageLinked(LINK_ALL_CHILDREN, 0, "stop", NULL_KEY);

myswitch=FALSE;

}

}

}

Part 3: Light Bulb Script
Put on the light source

default

{

state_entry()

{

llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);

}

link_message(integer sender_num, integer num, string str, key id)

{

if(str=="stop")

{

llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,FALSE]);

}

if(str=="start")

{

llSetPrimitiveParams([PRIM_FULLBRIGHT,ALL_SIDES,TRUE]);

}

}

}

Media Cheat Sheet - Attention future students of ARCHDRC102

Fold: A fold is a bend in an item or any other object.

Blob: A drop of a thick liquid or other viscous substance.

An exact yet rigorous form – Greg Lynn

Box: A container with a flat base and sides, typically square or rectangular and having a lid.

Analogue interactive elements: Doorhandles, light switches, windows, floor, stairs, sliding walls, phones, TVs

Digital interactive elements of architecture:

Nurb - Non-uniform rational basis spline (NURBS) is a mathematical model commonly used in computer graphics for generating and representing curves and surfaces which offers great flexibility and precision for handling both analytic and freeform shapes.

Open Source - Open-source software (OSS) is computer software that is available in source code form: the source code and certain other rights normally reserved for copyright holders are provided under a software license that permits users to study, change, improve and at times also to distribute the software.

Archicad - ArchiCAD is an architectural BIM CAD software for Macintosh and Windows. ArchiCAD is a complete design suite with 2D and 3D drafting, visualization and other functions for architects, designers and planners.

StudioMax - Autodesk 3ds Max, formerly 3D Studio MAX, is a modeling, animation and rendering package developed by Autodesk Media and Entertainment. It has modeling capabilities, a flexible plugin architecture and can be used on the Microsoft Windows platform. In addition to its modeling and animation tools, the latest version of 3ds Max also features shaders (such as ambient occlusion and subsurface scattering), dynamic simulation, particle systems, radiosity, normal map creation and rendering, global illumination, a customizable user interface, and its own scripting language.

Cognative surplus - A word coined by former Silicon Alley Reporter columnist Clay Shirky to describe the free time that people have on their hands to engage in collaborative activities, specially as applies to web 2.0.

Ecotech- Analyzing material software

BIM - Building Information Modeling (BIM) is the process of generating and managing building data during its life cycle[1]. BIM involves representing a design as objects – vague and undefined, generic or product-specific, solid shapes or void-space oriented (like the shape of a room), that carry their geometry, relations and attributes. BIM design tools allow for extracting different views from a building model for drawing production and other uses. These different views are automatically consistent - in the sense that the objects are all of a consistent size, location, specification - since each object instance is defined only once, just as in reality. Drawing consistency eliminates many errors.[2]. Typically it uses three-dimensional, real-time, dynamic building modeling software to increase productivity in building design and construction.[2].The process produces the Building Information Model (also abbreviated BIM), which encompasses building geometry, spatial relationships, geographic information, and quantities and properties of building components. Pieces can carry attributes for selecting and ordering them automatically, providing cost estimates and well as material tracking and ordering.[2].This method of management is more practical and efficient. It eliminates many of the uncertainties found during the construction phase since they can be found during the design phase of the project and fixed so they do not occur during the actual construction phase. Also, any changes during construction will be automatically updated to BIM and those changes will be made in the model. Modern BIM design tools go further. They define objects parametrically. That is, the objects are defined as parameters and relations to other objects, so that if a related object changes, this one will also.

Vector image - Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon(s), which are all based on mathematical equations, to represent images in computer graphics.

Vector graphics formats are complementary to raster graphics, which is the representation of images as an array of pixels, as is typically used for the representation of photographic images.[1] There are instances when working with vector tools and formats is the best practice, and instances when working with raster tools and formats is the best practice. There are times when both formats come together. An understanding of the advantages and limitations of each technology and the relationship between them is most likely to result in efficient and effective use of tools.

Computer displays are made up from grids of small rectangular cells called pixels. The picture is built up from these cells. The smaller and closer the cells are together, the better the quality of the image, but the bigger the file needed to store the data. If the number of pixels is kept constant, the size of each pixel will grow and the image becomes grainy (pixelated) when magnified, as the resolution of the eye enables it to pick out individual pixels.Vector graphics files store the lines, shapes and colors that make up an image as mathematical formulas. A vector graphics program uses these mathematical formulas to construct the screen image, building the best quality image possible, given the screen resolution. The mathematical formulas determine where the dots that make up the image should be placed for the best results when displaying the image. Since these formulas can produce an image scalable to any size and detail, the quality of the image is limited only by the resolution of the display, and the file size of vector data generating the image stays the same. Printing the image to paper will usually give a sharper, higher resolution output than printing it to the screen but can use exactly the same vector data file.

Raster image –

In computer graphics, a raster graphics image or bitmap is a data structure representing a generally rectangular grid of pixels, or points of color, viewable via a monitor, paper, or other display medium. Raster images are stored in image files with varying formats (see Comparison of graphics file formats).

A bitmap corresponds bit-for-bit with an image displayed on a screen, generally in the same format used for storage in the display's video memory, or maybe as a device-independent bitmap. A bitmap is technically characterized by the width and height of the image in pixels and by the number of bits per pixel (a color depth, which determines the number of colors it can represent).

The printing and prepress industries know raster graphics as contones (from "continuous tones") and refer to vector graphics as "line work".

Raster graphics are resolution dependent. They cannot scale up to an arbitrary resolution without loss of apparent quality. This property contrasts with the capabilities of vector graphics, which easily scale up to the quality of the device rendering them. Raster graphics deal more practically than vector graphics with photographs and photo-realistic images, while vector graphics often serve better for typesetting or for graphic design. Modern computer-monitors typically display about 72 to 130 pixels per inch (PPI), and some modern consumer printers can resolve 2400 dots per inch (DPI) or more; determining the most appropriate image resolution for a given printer-resolution can pose difficulties, since printed output may have a greater level of detail than a viewer can discern on a monitor. Typically, a resolution of 150 to 300 pixel per inch works well for 4-color process (CMYK) printing.

STL file – Can be used for interchanging date between CAD/CAM systems

Alpha Channel - In graphics, a portion of each pixel's data that is reserved for transparency information. 32-bit graphics systems contain four channels -- three 8-bit channels for red, green, and blue (RGB) and one 8-bit alpha channel. The alpha channel is really a mask -- it specifies how the pixel's colors should be merged with another pixel when the two are overlaid, one on top of the other.

What is a channel?

First, let's talk about channels in general. Depending on the color mode used a color image automatically has either three or four channels. If you are using the RGB color mode (used for anything viewed on a screen) the image has three channels; red, green and blue. If you are using the CMYK color mode (used for printed materials) the image has four channels. The information within these channels, specify how much of each color is used to make the output color, such as indigo, orange, pink etc. These channels are standard in any color image.

What is an alpha channel?

The alpha channel is an additional channel that can be added to an image. It contains transparency information about the image, and depending on the type of alpha it can contain various levels of transparency. The alpha channel basically controls the transparency of all the other channels. By adding the alpha channel to an image you control the transparency of the red channel, green channel and the blue channel.

There are two types of alpha channels, pre-multiplied alpha and straight alpha. Which alpha type you use depends on the software being used.

0. Pre-multiplied Alpha (used by Photoshop)

0. Straight Alpha

Pre-multiplied alpha

In this case the colors of the foreground are blended with the colors of the background. At the same time the alpha blends from opaque to transparent.

Straight alpha

In straight alpha the foreground and background colors stay the same, and only the alpha channel is blended.

File types that support alpha

The following are the file type that support alpha channel:

0. TIFF

0. TGA

0. PNG

0. PSD (Photoshop)

0. GIF (special alpha)

TIFF, TGA, PNG, PSD and GIF all support alpha but really only PNG and GIF are used for applications, and the web. Gif, however, uses a special type of alpha. Instead of the alpha channel in a GIF image containing degrees of transparency it only has an on/off transparency. This means that pixels within a GIF image can either be fully opaque or fully transparent. There is no in between. PSD is the Photoshop format, and can be used in most Adobe applications.

How is the alpha channel used?

The alpha channel can be used in several different ways. In many instances the alpha channel is used to seamlessly layer images over any color background or over other images. This is seen constantly in image editing software such as Photoshop. When you open an image and place another image on top Photoshop automatically translates the alpha so that the image is properly anti-aliased and looks smooth and crisp. In other cases elements such as shadows can be properly displayed over various backgrounds, and images. Photoshop also uses alpha channels to hold clipping masks and selection areas. Alpha channels can also be used to display semi-transparent images over backgrounds, images and even other semi-transparent images.

What are the benefits of using alpha channels?

The biggest benefit of using alpha channels is visual appeal. Without alpha channels images layered over one another would not be anti-aliased, and therefore, would have a blocky jagged edge to them. This is not at all attractive. Another benefit of alpha channels is speed. When you save an image with the alpha channel all of the opacity levels are saved with it. You can then place that image over anything you like and the image will still maintain its appearance. This saves time because you can place the image directly over a background without the need to save that image in exactly the right spot over that exact background.

Additive colour - An additive color model involves light emitted directly from a source or illuminant of some sort. The additive reproduction process usually uses red, green and blue light to produce the other colors. Combining one of these additive primary colors with another in equal amounts produces the additive secondary colors cyan, magenta, and yellow. Combining all three primary lights

(colors) in equal intensities produces white. Varying the luminosity of each light (color) eventually reveals the full gamut of those three lights (colors).

Subtractive colour - A subtractive color model explains the mixing of paints, dyes, inks, and natural colorants to create a full range of colors, each caused by subtracting (that is, absorbing) some wavelengths of light and reflecting the others. The color that a surface displays depends on which colors of the electromagnetic spectrum are reflected by it and therefore made visible.

Subtractive color systems start with light, presumably white light. Colored inks, paints, or filters between the viewer and the light source or reflective surface subtract wavelengths from the light, giving it color. If the incident light is other than white, our visual mechanisms are able to compensate well, but not perfectly, often giving a flawed impression of the "true" color of the surface.

Displacement mapping - is an alternative computer graphics technique in contrast to bump mapping, normal mapping, and parallax mapping, using a (procedural-) texture- or height map to cause an effect where the actual geometric position of points over the textured surface are displaced, often along the local surface normal, according to the value the texture function evaluates to at each point on the surface. It gives surfaces a great sense of depth and detail, permitting in particular self-occlusion, self-shadowing and silhouettes; on the other hand, it is the most costly of this class of techniques owing to the large amount of additional geometry.

For years, displacement mapping was a peculiarity of high-end rendering systems like PhotoRealistic RenderMan, while realtime APIs, like OpenGL and DirectX, were only starting to use this feature. One of the reasons for this is that the original implementation of displacement mapping required an adaptive tessellation of the surface in order to obtain enough micropolygons whose size matched the size of a pixel on the screen.

Final aspects of design completion

























































For the past day, I have been doing additional final touches to the outside of the building and the inside. From the bottom up of the structure, changes have included:

1) The addition of prims scattered across the extents of the tentacles of the building has worked with allowing me to show off some of my textures, alpha channels and particle systems. The prims, each representing a part of the internet: creativity, arts, information, etc are shown to be hunted down by the 'internet' library machine picked up and then subsequently imaginarily deposited within the mouth of the machine itself, as the internet swallows these part of society.

2) A general addition to the majority of the building are uploaded internet signs depicting transport direction road signals and warning stripes that have been scattered in corresponding areas around the building, both demonstrating the ideas of the internet being a complex but also directional source of information and knowledge if you follow instruction. The signs, particularly those with the warning stripes have been given slight glows (0.30) thus in the nighttime giving off slight "illumination" as a symbol beacon of hope where the internet is able to work as a library source providing us with information and a direction where we are lost and "all is dark".

3) Another addition has been the use of a train air whistle that serves similar aesthetic purposes as the trumpet like pipe and the exhaust pipe close to it.

4) Over the past few days, me and Campbell have been able to names all "10 million" prims that we created, a slight exaggeration but in reality there were a lot and in hindsight this probably should have been a regular daily thing to do in order to avoid the final accumulation of this task, or a potential development for the creator of Second Life is the ability to change the object name of a number of multiple selected prims? Could help a lot of people in the future.

5) In the interior we have spent the last few days scanning off our journal covers and placing them on one side of the rotating steam-punk screens. While we also thought about curved, slightly non-rectilinear screens, we also thought about function and how thin screens although perhaps not as unique as curved screens, they are also more functional in terms of use and the easiness of reading which is the purpose of any library and information source, with aesthetics and uniqueness following afterwards. On the other sides, we have attached our own personal alpha channels, both to show that we individually can do them, but also they should have some similarities in terms of genre to that of our journals as well as aesthetic backs to the journal coverings.

6) Additional bits have included the adding of lights on top of a number of screens, that are both light sources and have glow on them, with the best of both worlds mentality showing that we can do both, as well as Campbell trying out a light script on his red "lights" with arrows on top of his screens. Sam has played around with our secret weapon "The Greg Lynn-ator" with a plastering of Greg Lynn face on secret prims that are translucent on one side, and reveal upon command to hopefully give Judy a smile through her long day of marking and questioning. :)

All in all the general part of the assignment is done with the completion of loose threads in my lecture and tutorial sheets this morning. I have also created a Media "Cheat Sheet" with information regarding small aspects that Judy may bring up in our crit, as we have all been to crits everyday for the past few days and watched a large number of other groups we hope to avoid many of the pit falls that have plagued other groups.

Regards
Vasilije Rakovic









Continuation of the outside and inside display screens



































As shown in the pictures above, progress has continued swiftly on both the interior and exterior of the building. The exterior shots show the addition of a couple of new additions that I have spent the last day doing:

1) a large trumpet like thing
2) a spinning wheel
3) an exhaust pipe
4) an entrance board
5) a tap
6) an eye mechanism

1) The trumpet like structure, coloured in a red colour, with a medium shine and stucco bumpiness added to it, relates back to the overwhelming sense of machinery and industrialization that we would like to relate to about this being the idea of the internet as a machine that you can enter inside, while also having an almost child like Dr Seuss mentality of exaggeration that creating in such a liberal 3D world allows us to have without regard to physics or function. The structure will be kitted out with particle systems at the front of the spout that will throw out a visual pollution through the increase of particles being released by manipulation of my original script found from the internet on:

http://eloisepasteur.wordpress.com/learning-about-particles/#accelerate

and by increasing the max and min speeds of these particles and the final size of the particles to a few meters in diameter allowing what can be perceived as a ever continuing cloud exiting like smog that reflects all the potential harm and side-effects of the internet. The particles within the structure itself will be attached to a couple of boxes made 100% transparent thus making them completely invisible to the viewer while allowing the visual effect of the smoke coming up the pipe from the building within.

2) The spinning wheel has been added to show off the rotation script, allowing the wheel to spin forever or on demand (yet to be decided), with connections to the main structure via pipes and structural supports, while from the middle via an invisible box positioned within one of the apparent structural pipes, a form of particles system resembling sparks will be created. The particle system like before will utilise the general script I found off the internet, reducing the number of particles released per second, increasing the downwards acceleration to resemble that of sparks coming off the wheel, while the colour will also be changed using a RGB system (however this one from 0-1). What this means is that orange with a RGB value of 255 -165- 0 will mean that each number will have to be divided by 255 to get a corresponding value to be placed within the particle script to get that colour according to the new RGB system.

ie.

255/255 = 1
165/255 = 0.65
0/255 = 0

Hence: the new values to be put into the particle script will be 1 - 0.65- 0 to get the colour orange for the particles to make the sparks.

3) An exhaust pipe was supposed to reflect those found on large hummers and lorries for exhaust fumes, again using the textures found on the trumpet and using similar forms of particle systems to create fumes however making the particles systems radius of particles smaller, keeping the burst rate the same, thus creating almost a simmering visual feel to it.

4) An entrance board fitting in the theme of avante-garde, surreal machinery world of randomness, the board has a metal side, with cut out newspaper letters on the other side, with each letter on each block spelling out 'Welcome'. Upon writing 'welcome', a corresponding script on each letter will turn the letters in a 90 degree fashion side ways with each 'welcome' typed turning it these 90 degrees around, creating a very mechanical entrance way and welcoming system.

5) A tap on the bottom section of the structure consists of a couple of prims in a shape of a tap, a script placed on a twisted semi translucent blue prim that twists simulating water and a blue particle system placed down the bottom recreating water droplets splashing onto the ground.
The particle systems derived from the original script found on the internet have a high rate of spreading away from the tap showing the force of the water hitting the ground, while the script spinning the water indefinitely shows the water as coming out of the tap visually but also reflecting the idea of the internet being as a library 'thinktank' with all this information just flowing up to fertilize the ground and the world around it.

6) An eye mechanism almost a joke on a security camera opens when the written command 'eye' is placed, opening up the eyelids for five seconds showing a eye texture on the back prim that looks at the user and then after the five seconds closes again, playing again on the ideas of the surreal and lack of reality that is need in such 3D programs.

Finally inside our idea for the demonstration of our 3 journals each and additional blogs and websites is that the visitor would enter this internal machine filled up with pipes and lights and interactive objects, with each face having a script that would twist it within its portrait frame 180 degrees. On one side we would have a scan of our journal while on the other a demonstration of our alpha channels or similar that would give design depth to it. We have also tried to attempt using a light script by linking 2 prims together. One that would act as a light source and one that would act as the switch. We tried this in the actual Second Life browser during out weekly tutorial sheets, successfully putting a script developed onto the internet, one for the root (the switch) and one for the light source, whereupon when the root is touched, the light lights up. The two prims are then linked by use of shift select, with the light source selected first then the root, then the use of control - L to link the two objects together. Unfortunately, this didn't work on my browser (pheonix) despite many attempts to do so, so had to be abandoned, while I have also had problems in the last hour or so of many of my indefinite scripts just turning off no apart reason, which even when deleting and re-pasting the scripts doesn't seem to fix.










ArchiCAD Treehouse













As part of our in class tasks was to create a a tree house on ArchiCad using a variety of different bits including creating a slab, columns, windows, doors, objects, plants and the roof. Althoughafter a bit of playing andexperimenting with the different tools and aspects of the program for the past couple of times I had used the program I came up with a lot of problems involving the roof. Namely, the problem of the roof appearing at ground level. This was solved by clicking the roof storey button on the right hand side, although after some more additions this also didn't seem to work with the roof still showing up through the middle of the house. Kyle D'Mello from another group showed me a simple way of right clicking the roof and by the use of a drag tool positioning the roof to a suitable height and position corresponding to the house, making it successfully look normal which was the aim.

Shown are the axonometric view, a perspective and a section with the accompanying house showing some of the objects used such as the people of the house to show scale, trees and planting for added realism and a table tennis table, a toy and leisure activity for the occupants of the possible house to enjoy.



Alpha Channels & Other Tools



















According to http://www.icongalore.com/xp-icon-articles/alpha-channel-explained.htm an alpha channel is:

The alpha channel is an additional channel that can be added to an image. It contains transparency information about the image, and depending on the type of alpha it can contain various levels of transparency. The alpha channel basically controls the transparency of all the other channels. By adding the alpha channel to an image you control the transparency of the red channel, green channel and the blue channel.

There are two types of alpha channels, pre-multiplied alpha and straight alpha. Which alpha type you use depends on the software being used.
  • Pre-multiplied Alpha (used by Photoshop)
  • Straight Alpha

To create an alpha channel, I first entered into photoshop, created a new 500 pixel times 500 pixels new blank block, clicked the channels section making sure that it was set to RGB and then at the bottom added in the new channel, the Alpha channel. From there I turned off the RGB channels and playing around with a number of brushes and drawing tools that created a white colour on the black background that was now my block covered by the alpha channel. I tried to experiment in the form of inspiration from my 3 journals and created 3 alpha channels, saving each one in .tga format in a 32 bit pixel format to allow it to be applied and uploaded into NZVWG (note: make sure that all channels are visible when saving). It worked a treat the first time round and I am very greatful that Sam Peters from our room figured this out earlier in order to make life a whole lot easier for us.

In addition in creating the alpha channel I utilized the offset filter setting, changing the offset by half of my pixel block dimensions (ie. 250 pixels vertically and horizontally) and by manipulation of the design to connect, a seamless form can be created when applied in NZVWG if I want to use many repeated grids of the texture, otherwise it can seem really griddy and broken up in appearance which detracts from the beauty of the form emphasized by the material itself.

I also further experimented with the offset filter by use of colour, using the offset filter to half the block dimensions and using further added noise through the Noise filter I was able to create almost a pointilist texture, made from millions of slightly different coloured dots that made the red and blue texture shown (left) look slightly pixilated but done on purpose. The result was an interesting artistic texture that could be used within our building for added colour and interest.

Another interesting tool was the clone tool which allows for a selected area of a image to be set as the centre using alt click and then be swiping the clone tool around the rest of the image the centred point and size of the brush will enable that centralized area and corresponding mouse movements to copy that area to the place where the mouse is now being swiped. This enable the creation of textures looking very much like impressionist oil painting which were interesting in terms of what can be achieved through a variety of tools found on Photoshop.