Project

General

Profile

« Previous | Next » 

Revision ec231614

Added by Leszek Koltunski about 7 years ago

Major refactoring: convert the Matrix Effects to be independent of the resolution of the surface we render to.

Re-write the first 15 apps to work with this.

View differences:

src/main/java/org/distorted/library/DistortedEffects.java
638 638
/**
639 639
 * Moves the Object by a (possibly changing in time) vector.
640 640
 * 
641
 * @param vector 3-dimensional Data which at any given time will return a Static3D
642
 *               representing the current coordinates of the vector we want to move the Object with.
641
 * @param vector 3-dimensional Data which at any given time will return a Static3D representing
642
 *               the current coordinates of the vector we want to move the Object with.
643
 *               Units: to make it independent of the dimensions of the surface we are rendering to,
644
 *               the vector's unit is the size of the surface in each direction; i.e. a move(0.3,0.7,0.0)
645
 *               will move our object 30% of the width of the surface to the right and 70% of its height
646
 *               down.
643 647
 * @return       ID of the effect added, or -1 if we failed to add one.
644 648
 */
645 649
  public long move(Data3D vector)
......
653 657
 * 
654 658
 * @param scale 3-dimensional Data which at any given time returns a Static3D
655 659
 *              representing the current x- , y- and z- scale factors.
660
 *              Example: a scale(2,1,-0.5) makes the object 2 times wider, keeps the height
661
 *              unchanged, and makes it twice thinner in Z-axis shifting the originally further
662
 *              wall in front of the originally closer to the camera one.
656 663
 * @return      ID of the effect added, or -1 if we failed to add one.
657 664
 */
658 665
  public long scale(Data3D scale)
......
675 682
///////////////////////////////////////////////////////////////////////////////////////////////////
676 683
/**
677 684
 * Rotates the Object by 'angle' degrees around the center.
678
 * Static axis of rotation is given by the last parameter.
685
 * Static axis of rotation is given by the 2nd parameter.
679 686
 *
680 687
 * @param angle  Angle that we want to rotate the Object to. Unit: degrees
681 688
 * @param axis   Axis of rotation
......
720 727
 *
721 728
 * @param shear   The 3-tuple of shear factors. The first controls level
722 729
 *                of shearing in the X-axis, second - Y-axis and the third -
723
 *                Z-axis. Each is the tangens of the shear angle, i.e 0 -
730
 *                Z-axis. Each is the tangent of the shear angle, i.e 0 -
724 731
 *                no shear, 1 - shear by 45 degrees (tan(45deg)=1) etc.
725 732
 * @param center  Center of shearing, i.e. the point which stays unmoved.
726 733
 * @return        ID of the effect added, or -1 if we failed to add one.

Also available in: Unified diff