Showing posts with label ANIMATIONS & REALISM. Show all posts
Showing posts with label ANIMATIONS & REALISM. Show all posts

Friday, December 4, 2015

Ray Tracing / Ray Casting



Tracing / Ray Casting
- Provides a related , powerful approach to render scenes
Overview of Ray Tracing Process
Pseudo code of a ray tracer:
  for(int r = 0; r <nRows ; r++)
  for(int c = 0; c <nCols ; c++)
            {
1.                   build the rc-th ray
2.                   find all intersections of the rc-th ray with objects in the scene
3.                  Identify the intersection that lies closest to and in front of the eye
4.                  Compute the hit point where the ray hits this object and the normal vector at that point
5.                  Find the color of the light returning to the eye along the ray from the point of intersection
6.                   place the color in the rc-th pixel
}                                 
Intersection of a Ray with an Object
Common shapes used in ray tracing
§     Sphere
§     Cylinder
§     Cone cube
§     hex cone
If ‘S’ is the starting point of a ray and ‘c’ is its direction then the ray that intersects with a shape is given by
  r(t) = S + ct         // implicit form of shape is F(P)
Condition for r(t) to coincide with a point of the surface is
  F(r(t)) = 0
The hit time thit  can be found by solving
  F(S+ c thit ) = 0
Intersection of a Ray with the Generic Plane
§      generic plane – xy plane or z = 0
§     Implicit form is F(x ,y , z) = z
§     The ray S+ct intersects the generic plane when
            Sz +czth = 0 , where th = - ( Sz  /  cz )
If cz = 0 , the ray is moving parallel to the plane & there is no intersection
Otherwise , the ray hits the plane at the point Phit = S – c(Sz / cz )
Intersection of a Ray with the Generic Shape
§     Consider a generic shape whose implicit form is F(P) = |P|2 – 1
§     The point of intersection of the ray is given by |S + ct |2   - 1 = 0
  |c|2T2 + 2.(S.C)t + (|S|2 - 1) = 0   which is of the form At2  +2Bt + c = 0
by solving   th = -(B/A) ±(√B2 – AC)/ A
ü    If B2  - Ac is ‘-’ ve , the ray misses the sphere
ü    If B2  - Ac  is zero , the ray grazes the sphere at one point
ü    If B2  - Ac is ‘+’ ve , there are 2 hit times t1& t2



Wednesday, December 2, 2015

Peano curves



Peano curves
Space filling curves (completely fill a region of space )
Have fractal dimension of 2
     Ex.  Hilbert curves, Sierpinski curves
     Polya’sPeano curve
Generated by replacing each segment of a generation by a right angled elbow
Direction of the elbow alternate in a L , LR , LRLR ,… fashion
To save the current state and to restore characters ‘]’  and ‘]’ are added to the language
L – Systems
Approach to generate curves
Generate curves based on simple set of rules ( productions)
String Production rules
                 F  àF – F  ++ F – F
F means forward (1,1)
+ means turn(A)
- means turn(-A)
à Means that every F is replaced by F – F  ++ F – F
Atom – initial string
    Production rules are applied to atom to produce the first generation string (S1 ) 
Generation of richer set of curves
by adding more rules to string production process richer set of curves can be generated
Ex. Dragon curves
                 F  àF
                 X  àX + YF +
                 Y  à – FX – Y
Atom  = FX
Order1 String S1                                       Order2 String S2
Atom  =  FX
S1   =  FX + YF +                          S2   =  FX + YF ++ – FX – YF +

      To generate the second generation string the same production is applied to the  first generation string

Monday, November 30, 2015

ANIMATIONS & REALISM



1.What is animation? (AU NOV/DEC 2011)
Computer animation generally refers to any time sequence of visual changes in a scene. In addition to changing object positions with translations or rotations, a computer generated animation could display time variations in object size, color, transparency or surface texture. Animations often transition from one object shape to another.
2.Mention the steps in animation sequence.
Storyboard layout, Object definitions, Key-frame specifications, Generation of in-between frame.
3. Explain about frame-by-frame animation.
Frame-by-frame animation, each frame of the scene is separately generated and stored. Later the frame scan be recorded on film or they can be consecutively displayed in “real time playback” mode.
4.Define key frames. (AU NOV/DEC 2011)
A key frame is a detailed drawing of the scene at a certain time in the animation sequence. Within each key frame, each object is positioned according to the time for that frame. Some key frames are chosen at extreme positions in action; others are spaced so that the time interval between key frames is not too great. More key frames are specified for intricate motions than for simple, slowly varying motions.
5.What are in between frames?
In-betweens are the intermediate frames between the key frames. The number of in-betweens needed is determined by the media to be used to display the animation. Film requires 24 frames per second and graphics terminals are refreshed at the rate of 30 to 60 frames per second.
6.Mention the different types of animation. (AU MAY/JUNE 2012 IT)
The different types of animation are:
Ø    Raster animation
·         Raster operations: generate real-time animation in limited applications using raster operations.
·         Color-table transformations: animate objects along 2D motion paths
Ø    Key-frame system: specialized animation languages designed to generate the in-between frames
from user specified key frames.