Project

General

Profile

« Previous | Next » 

Revision e8b2f311

Added by Leszek Koltunski over 7 years ago

boundingVertices fully work now!

View differences:

src/main/java/org/distorted/library/MeshCubes.java
292 292
  private int addLeftmost(float[] temp, int row, int index)
293 293
    {
294 294
    float x2 = retLeftmost(row)/mCols - 0.5f;
295
    float y2 = (float)row      /mRows - 0.5f;
295
    float y2 = 0.5f - (float)row/mRows;
296 296

  
297 297
    if( index>1 )
298 298
      {
......
301 301
      float x1 = temp[2*index-2];
302 302
      float y1 = temp[2*index-1];
303 303

  
304
      while( (x0-x2)*(y0-y1) <= (x0-x1)*(y0-y2) )
304
      while( (x0-x2)*(y0-y1) >= (x0-x1)*(y0-y2) )
305 305
        {
306 306
        if( --index>1 )
307 307
          {
......
324 324
  private int addRightmost(float[] temp, int row, int index)
325 325
    {
326 326
    float x2 = retRightmost(row)/mCols - 0.5f;
327
    float y2 = (float)row       /mRows - 0.5f;
327
    float y2 = 0.5f - (float)row/mRows;
328 328

  
329 329
    if( index>1 )
330 330
      {
......
333 333
      float x1 = temp[2*index-2];
334 334
      float y1 = temp[2*index-1];
335 335

  
336
      while( (x0-x2)*(y0-y1) >= (x0-x1)*(y0-y2) )
336
      while( (x0-x2)*(y0-y1) <= (x0-x1)*(y0-y2) )
337 337
        {
338 338
        if( --index>1 )
339 339
          {

Also available in: Unified diff