Changeset 338

Show
Ignore:
Timestamp:
03/18/07 23:37:38 (1 year ago)
Author:
cweider2
Message:

LZ3DTorus: parameterized on time

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/LaserLine_2.0/Src/Sequencing/Generators/LZ3DTorus.h

    r334 r338  
    88 
    99#import <Cocoa/Cocoa.h> 
     10#import <sys/time.h> 
    1011#import <RawTypes.h> 
    1112#import "LZSequenceableElement.h" 
     
    1718{ 
    1819 
    19         int frameIndex; 
    20  
    2120} 
    2221 
  • trunk/LaserLine_2.0/Src/Sequencing/Generators/LZ3DTorus.m

    r335 r338  
    2424        if(self) 
    2525        { 
    26                frameIndex = 0
     26       
    2727        } 
    2828        return self; 
     
    3131- (RawFrame)renderAtPosition:(float)position 
    3232{ 
     33        struct timeval time; 
     34        gettimeofday(&time,NULL); 
    3335         
    3436        unsigned pointCount = 500; 
     
    3840        const float Ra = 2; 
    3941        const float Rb = .5; 
    40         const short FRAMES = 4000; 
    4142 
    42         if(frameIndex >= FRAMES){ 
    43                 frameIndex = 0; 
    44         }else{ 
    45                 frameIndex = frameIndex + 10; 
    46         } 
    47  
    48         float xrot = frameIndex * 8 * PI/FRAMES; 
    49         float yrot = frameIndex * 4.6 * PI/FRAMES; 
    50         float zrot = frameIndex * 3.25 * PI/FRAMES; 
     43        float xrot = (time.tv_sec + time.tv_usec/1000000)/500000000*position * 8 * PI; 
     44        float yrot = (time.tv_sec + time.tv_usec/1000000)/500000000*position * 4.6 * PI; 
     45        float zrot = (time.tv_sec + time.tv_usec/1000000)/500000000*position * 3.25 * PI; 
    5146         
    5247        for (int p = 0 ; p <= pointCount ; p++) {