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/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