Site banner
.
Home Forums Blogs Articles Photos Videos Contact FAQ                    
.
.
Wisdom Archive
Body Mind and Soul
Faith and Belief
God and Religion
Law of Attraction
Life and Beyond
Love and Happiness
Peace of Mind
Peace on Earth
Personal Faith
Spiritual Festivals
Spiritual Growth
Spiritual Guidance
Spiritual Inspiration
Spirituality and Science
Spiritual Retreats
More Wisdom
Buddhism Archives
Hinduism Archives
Sustainability
Theology Archives
Even more Wisdom
2012 - Year 2012
Affirmations
Aura
Ayurveda
Chakras
Consciousness
Cultural Creatives
Diksha (Deeksha)
Dream Dictionary
Dream Interpretation
Dream interpreter
Dreams
Enlightenment
Essential Oils
Feng Shui
Flower Essences
Gaia Hypothesis
Indigo Children
Kalki Bhagavan
Karma
Kundalini
Kundalini Yoga
Life after death
Mayan Calendar
Meaning of Dreams
Meditation
Morphogenetic Fields
Psychic Ability
Reincarnation
Spiritual Art, Music & Dance
Spiritual Awakening
Spiritual Enlightenment
Spiritual Healing
Spirituality and Health
Spiritual Jokes
Spiritual Parenting
Vastu Shastra
Womens Spirituality
Yoga Positions
Site map 2
Site map


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



.

Computer animation - Detailed examples and pseudocode

Computer animation - Detailed examples and pseudocode: Encyclopedia II - Computer animation - Detailed examples and pseudocode

In 2D computer animation, moving objects are often referred to as “sprites.” A sprite is an image that has a location associated with it. The location of the sprite is changed slightly, between each displayed frame, to make the sprite appear to move. The following pseudocode makes a sprite move from left to right: var int x := 0, y := screenHeight &div; 2; while x < screenWidth drawBackground() drawSpriteAtXY(x, y) // draw on to ...

See also:

Computer animation, Computer animation - A simple example, Computer animation - Explanation, Computer animation - Creating characters and objects on a computer, Computer animation - Equipment, Computer animation - Technical details, Computer animation - The Future, Computer animation - Detailed examples and pseudocode, Computer animation - Movies and TV shows

Computer animation, Computer animation - A simple example, Computer animation - Creating characters and objects on a computer, Computer animation - Detailed examples and pseudocode, Computer animation - Equipment, Computer animation - Explanation, Computer animation - Movies and TV shows, Computer animation - Technical details, Computer animation - The Future, Animation - Introductory Root page, Computer-generated imagery (CGI), Computer Graphics Lab and the project The Works, Wire frame model, Computer representation of surfaces, Motion capture, Avar (animation variable), Pixar Animation Studios, Rhythm and Hues Studios, Skeletal animation, Morph target animation, Timeline of CGI in movies

Computer animation: Encyclopedia II - Computer animation - Detailed examples and pseudocode



Computer animation - Detailed examples and pseudocode

In 2D computer animation, moving objects are often referred to as “sprites.” A sprite is an image that has a location associated with it. The location of the sprite is changed slightly, between each displayed frame, to make the sprite appear to move. The following pseudocode makes a sprite move from left to right:

 var int x := 0, y := screenHeight &div; 2;
 while x < screenWidth
     drawBackground()
     drawSpriteAtXY(x, y)  // draw on top of the background
     x := x + 5  // move to the right

Modern (2001) computer animation uses different techniques to produce animations. Most frequently, sophisticated mathematics is used to manipulate complex three dimensional polygons, apply “textures”, lighting and other effects to the polygons and finally rendering the complete image. A sophisticated graphical user interface may be used to create the animation and arrange its choreography. Another technique called constructive solid geometry defines objects by conducting boolean operations on regular shapes, and has the advantage that animations may be accurately produced at any resolution.

Let's step through the rendering of a simple image of a room with flat wood walls with a grey pyramid in the center of the room. The pyramid will have a spotlight shining on it. Each wall, the floor and the ceiling is a simple polygon, in this case, a rectangle. Each corner of the rectangles is defined by three values referred to as X, Y and Z. X is how far left and right the point is. Y is how far up and down the point is, and Z is far in and out of the screen the point is. The wall nearest us would be defined by four points: (in the order x, y, z). Below is a representaion of how the wall is defined.

 (0, 10, 0)                        (10, 10, 0)





 (0,0,0)                           (10, 0, 0)

The far wall would be:

(0, 10, 20)                        (10, 10, 20)





(0, 0, 20)                         (10, 0, 20)

The pyramid is made up of five polygons: the rectangular base, and four triangular sides. To draw this image the computer uses math to calculate how to project this image, defined by three dimensional data, onto a two dimensional computer screen.

First we must also define where our view point is, that is, from what vantage point will the scene be drawn. Our view point is inside the room a bit above the floor, directly in front of the pyramid. First the computer will calculate which polygons are visible. The near wall will not be displayed at all, as it is behind our view point. The far side of the pyramid will also not be drawn as it is hidden by the front of the pyramid.

Next each point is perspective projected onto the screen. The portions of the walls ‘farthest’ from the view point will appear to be shorter than the nearer areas due to perspective. To make the walls look like wood, a wood pattern, called a texture, will be drawn on them. To accomplish this, a technique called “texture mapping” is often used. A small drawing of wood that can be repeatedly drawn in a matching tiled pattern (like wallpaper) is stretched and drawn onto the walls' final shape. The pyramid is solid grey so sp its surfaces can just be rendered as grey. But we also have a spotlight. Where its light falls we lighten colors, where objects blocks the light we darken colors.

Next we render the complete scene on the computer screen. If the numbers describing the position of the pyramid were changed and this process repeated, the pyramid would appear to move.

Other related archives

1970s, 2001, 2D computer graphics, 3D Studio Max, 3D computer graphics, A Bug's Life, Adventures of Jimmy Neutron: Boy Genius, Animation, Animusic, Antz, Avar (animation variable), Avars, Barnyard, Beast Machines, Beast Wars, Blender, Bryce, CRTs, Chicken Little, Computer Graphics Lab, Computer generated imagery, Computer representation of surfaces, Computer-generated imagery, Dragon Booster, Father of the Pride, Final Fantasy: The Spirits Within, Finding Nemo, Foster's Home for Imaginary Friends, Futurama, Game Over (TV series), Ice Age, Linux, Mac OS X, Madagascar, Maya, Mental Ray, Microsoft Windows, Monsters Inc., Morph target animation, Motion capture, Pixar, Pixar Animation Studios, Pixar's, Poser, ReBoot, Rendering, Renderman, Rhythm and Hues Studios, Robots, Rolie Polie Olie, Root page, Shadow Raiders, Shark Tale, Shrek, Skeletal animation, SoftImage XSI, The Ant Bully, The Fairly OddParents, The Incredibles, The Polar Express, The Works, Thomas & Friends, Timeline of CGI in movies, Toy Story, TrueSpace, Vector graphics, Veggie Tales, Waking Life, Wire frame model, animation, bluescreens, brain, cel shading, computer graphics, computers, constructive solid geometry, double buffering, electron guns, eye, film, frames per second, graphical user interface, independent animation, mathematics, medium, modern era of U.S. animation, motion capture, motion pictures, movie cameras, movies, performance capture, persistence of vision, polygons, props, render farm, rendered, rendering, scene, screen, special effects, sprites, stick figure, stop motion, television, television shows, texture mapping, textures, video camera, virtual reality, wallpaper, workstation



Adapted from the Wikipedia article "Detailed examples and pseudocode", under the G.N U Free Docmentation License. Please also see http://en.wikipedia.org/wiki

More material related to Computer Animation can be found here:
Main Page
for
Computer Animation
Index of Articles
related to
Computer Animation


« Back








Search the Global Oneness web site
Global Oneness is a huge, really huge, web site. Almost whatever you are searching for within health, spirituality, personal development and inspirationals - you will find it here!
Google
 
 

Rate this article!

Please rate this article with 10 as very good and 1 as very poor.

.








Sneak-Peek of Global Oneness Community

Hi friend! The Global Oneness Community, the place for information and sharing about Oneness is not really launched yet (you will see there is still some clean up to do) ...but it is now open for a sneak-peek! And if you wish - please register and become one of the very first members to do so! Jonas

Forum Home, Articles, Photo Gallery, Videos, News, Sitemap
...and much more!


Dream Sharing Forum

at Global Oneness Community.

Share your dreams and let others help you with the interpretation!
Dream Sharing Forum



Forum
Articles
Images Pictures
Videos
News
Sitemap




 

 

 

 

 


 








  » Home » » Home »