Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Clipping distorts the texture mapping.

yaniryanir Member Posts: 1
I am writing a 3d engine in pascal, and I have a problem. When a texture-mapped polygon goes out of the screen borders and needs to be clipped, it's texture get's distorted like it's sucked outside. I have 3d clipping with parametric equations, and I am changing the U,V coordinates just like the x,y,z coordinates, and it works fine for x,y,z coordinates, but not for u,v. How should I clip the U and V coordinates?
Please help me.

Comments

  • yoni_perryyoni_perry Member Posts: 1
    : I am writing a 3d engine in pascal, and I have a problem. When a texture-mapped polygon goes out of the screen borders and needs to be clipped, it's texture get's distorted like it's sucked outside. I have 3d clipping with parametric equations, and I am changing the U,V coordinates just like the x,y,z coordinates, and it works fine for x,y,z coordinates, but not for u,v. How should I clip the U and V coordinates?
    : Please help me.
    :


    Halo Yone. Sup?
    I've had the same problem and solved it last night at 5 AM (I had trouble sleeping...).
    All you have to do is put the devides of u,v,z (the part where you change z to 1/z, u to u/z...) BEFORE the clipping but AFTER the perspective formulas, that's all.
  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    _ | http://forcoder.org | free video tutorials and ebooks about \ Visual Basic, R, C, PL/SQL, PHP, Go, Scratch, Perl, Java, C#, C++, JavaScript, Python, Visual Basic .NET, Assembly, Delphi, Swift, Objective-C, MATLAB, Ruby Lua, Bash, Scheme, Kotlin, Erlang, Hack, Fortran, LabVIEW, Apex, ML, D, Transact-SQL, Awk, Dart, FoxPro, Lisp, Julia, COBOL, Ada, Rust, VBScript, Logo, F#, Alice, Clojure, Crystal, ABAP, SAS, Prolog, Scala \ _____________

Sign In or Register to comment.