Bug 1097 : Texture distortion using P3D without smooth()
Last modified: 2009-06-12 04:30




Status:
RESOLVED
Resolution:
WONTFIX -
Priority:
P2
Severity:
normal

 

Reporter:
SamH
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-12-06 22:35
Using Processing 1.0.1 + Mac OS 10.5.5 on a MBP 2.33 Intel Core Duo.

Textures mapped to a surface in P3D get distorted when the shape is rotated.

The problem is visible in the example at
http://processing.org/learning/3d/texture1.html

The issue is fixed with the addition of smooth() before mapping the texture:

[quote]
  [color=#CC6600]textureMode[/color]( NORMALIZED );
  [color=#7E7E7E]//smooth(); // uncomment this line to fix the texture
mapping error[/color]

  [color=#CC6600]beginShape[/color]([color=#006699]QUADS[/color]);
    [color=#CC6600]texture[/color]( img );
    [color=#CC6600]vertex[/color]( - wd, - ht, 0.0f, 0, 0 );
    [color=#CC6600]vertex[/color]( wd, - ht, 0.0f, 1, 0 );
    [color=#CC6600]vertex[/color]( wd, ht, 0.0f, 1, 1 );
    [color=#CC6600]vertex[/color]( - wd, ht, 0.0f, 0, 1 );
  [color=#CC6600]endShape[/color]();
  
  [color=#CC6600]endDraw[/color]();

[/quote]

See
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=OpenGL;action=display;num=1228516776
Additional Comment #1 From fry 2009-02-19 18:07
Either use the OpenGL renderer, or use smooth(). Fixing this problem is a
significant speed hit, and is part of the algorithm used by smooth().
Additional Comment #2 From mkn 2009-03-10 06:35
Though, P3D and smooth() seems to be a bad coctail foir the mo. Add a
smooth() to Examples/3D/Textures/TextureCube. Notice the sharp line that
cuts through the surfaces. XP, P 1.0.3, JDK 6u12.
Additional Comment #3 From fry 2009-05-31 16:04
(In reply to comment #2)
> Though, P3D and smooth() seems to be a bad coctail foir the mo. Add a
> smooth() to Examples/3D/Textures/TextureCube. Notice the sharp line that
> cuts through the surfaces. XP, P 1.0.3, JDK 6u12.

Correct, and that's covered in the reference for smooth().
http://processing.org/reference/smooth_.html
Additional Comment #4 From fry 2009-06-12 04:30
*** Bug 1274 has been marked as a duplicate of this bug. ***