sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    [Question] Is it possible to get a point on UV ?

    Scheduled Pinned Locked Moved Developers' Forum
    9 Posts 2 Posters 279 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PixeroP Offline
      Pixero
      last edited by

      Is it possible to get a specific point on the UV's?
      I've looked at the UVHelper but I dont get how it works. And whats that with using textureWriter with UVHelper?

      What I want is something like

      point = face.texture_coord (u,v)
      

      to be able to color each "point" on a face differently instead of each face getting the same color.

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        Yea, the texture write is a bit weird.

        @pixero said:

        to be able to color each "point" on a face differently instead of each face getting the same color.

        Not quite sure what you mean by this... You want colour information? Or you want the 3D co ordinate of that specific UV point on that face?

        Thomas Thomassen — SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • PixeroP Offline
          Pixero
          last edited by

          I'm looking for a way of accessing each point of a surface/texture.
          I've experimented with textures like the ones Chris Fullmer has written and having access to any UV point that would (hopefully) make it possible to write procedural textures like noise or gradient ramps. It would make it possible to do smooth shading of a surface instead of the
          one-color-per-face gradient type that is currently possible.

          I've written a lot of mentalray shaders and was hoping to find a way of "porting" at least some of that to SU.

          In mentalray you have for example:
          state->point that gives you the intersection point of a surface.
          state->tex_list[0].x which gives you the U in UV coordinate and so on.

          I dont understand how UVHelper works?
          In the Ruby docs it says:
          face.outer_loop.vertices.each do |vert|
          uvq = uv_helper.get_front_UVQ(vert.position)

          Does that gives you just the position of the geometric vertices or also every UV point inbetween the vertices?
          I don't know if I make myself clear.

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            @pixero said:

            I'm looking for a way of accessing each point of a surface/texture.

            Still don't understand what you by "point" - I take it it's not an Point3d object?

            SU's methods lets you get the UV (x,y) coordinates of a Point3d object. That's about it.

            There is no way you can read/write colour data. That is unless you find a way to read the image formats the Sketchup uses. There's no built-in methods that does that.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • PixeroP Offline
              Pixero
              last edited by

              @thomthom said:

              SU's methods lets you get the UV (x,y) coordinates of a Point3d object. That's about it.

              Forget about any color data at the moment.
              UV's are 0 to 1, right?
              Lets say we have a face with its four corner vertices at 0,0 0,1 1,0 and 1,1 in UV space.
              Now if I want to access a "UV position"/"point" between these, lets say 0.5, 0.5 (or any other "UV position").
              Is that possible?

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                Yes, you can get any Point3D from any UV co-ordinates as long as it's on the face's plane.

                Thomas Thomassen — SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • PixeroP Offline
                  Pixero
                  last edited by

                  Yes, now I'll start digging...

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    I got two plugins that deals with UV mapping. You can look at how I use it - maybe that gives you some clues to what you want to do.

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • PixeroP Offline
                      Pixero
                      last edited by

                      I will, thanks.

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      Buy SketchPlus
                      Buy SUbD
                      Buy WrapR
                      Buy eBook
                      Buy Modelur
                      Buy Vertex Tools
                      Buy SketchCuisine
                      Buy FormFonts

                      Advertisement