Project

General

Profile

« Previous | Next » 

Revision e642b4aa

Added by Leszek Koltunski almost 8 years ago

Vertex3D almost finished - there's still a problem when parts of Cubes get culled if the Object gets Deformed or Distorted to the left (curiously only the 'left' direction seems to trigger this!)

View differences:

src/main/java/org/distorted/examples/vertex3d/Vertex3DActivity.java
388 388

  
389 389
  private void computeSink()
390 390
    {
391
    fsinkA = (sinkA>= 50 ? sinkA-49 : 1/(51-sinkA));
391
    fsinkA = (sinkA>= 50 ? 0.18f*sinkA-8.0f : 0.018f*sinkA + 0.1f);
392 392

  
393 393
    Vertex3DRenderer.setSink( fsinkA );
394 394
    }
src/main/java/org/distorted/examples/vertex3d/Vertex3DRenderer.java
181 181

  
182 182
      if( width*mRows > height*mCols ) // screen is more 'horizontal' than the shape
183 183
        {
184
        factor = height/((mRows+2)*SIZE);
185
        }
184
        factor = ((float)height)/((mRows+2)*SIZE);
185
}
186 186
      else
187 187
        {
188
        factor = width/((mCols+2)*SIZE);
188
        factor = ((float)width)/((mCols+2)*SIZE);
189 189
        }
190 190

  
191
      mCube.scale(factor);
192 191
      mCube.move( new Static3D( (width-factor*mCols*SIZE)/2 , (height-factor*mRows*SIZE)/2 , 0) );
192
      mCube.scale(factor);
193 193

  
194 194
      Static3D center = new Static3D(mCols*SIZE/2,mRows*SIZE/2, 0);
195 195

  

Also available in: Unified diff