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

    Know how to set the texture coordinate in sketchup 6

    Scheduled Pinned Locked Moved SketchUp Discussions
    sketchup
    7 Posts 4 Posters 2.6k Views 4 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.
    • F Offline
      freesui1984
      last edited by

      Hi,

      i want to know how to set the texture coordinate in sketchup 6. I have
      found that there is texture menu->position, that can set the texture
      to map to what you want. but what i need is to change the texture
      coordinate in [0,1], which could make me extract the correct texture
      coordinate values to OpenGl to remap the texture to the model. Could
      anyone give me some clues?

      1 Reply Last reply Reply Quote 0
      • R Offline
        remus
        last edited by

        I dont think you can do exact positioning with the normal SU texture tools.

        If you go file->import->texture though, you can position the texture more exactly in your model. Might be worth a try.

        http://remusrendering.wordpress.com/

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

          You could create a guide point to where you want the texture to have it's origin, then use the Texture->Position tool to move it to that point, the texture handles snaps to geometry.

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

          1 Reply Last reply Reply Quote 0
          • F Offline
            freesui1984
            last edited by

            @remus said:

            I dont think you can do exact positioning with the normal SU texture tools.

            If you go file->import->texture though, you can position the texture more exactly in your model. Might be worth a try.

            Yes, i know.But i think you don't understand what i mean.i use .dae file exported from SketchUp. For example, i draw a cube, and i export it to .dae file. Then i got some vertex, normal and texture coordinates respectively. The following codes are what i got:

            
            
            <source id="mesh1-geometry-uv"> 
              <float_array id="mesh1-geometry-uv-array" count="48">-178.350505 121.322840 -48.100505 84.572840 -48.100505 121.322840 -178.350505 84.572840 121.322840 0.000000 84.572840 12.000000 84.572840 0.000000 121.322840 12.000000 -178.350505 0.000000 -48.100505 12.000000 -178.350505 12.000000 -48.100505 0.000000 -84.572840 0.000000 -121.322840 12.000000 -121.322840 0.000000 -84.572840 12.000000 48.100505 0.000000 178.350505 12.000000 48.100505 12.000000 178.350505 0.000000 178.350505 84.572840 48.100505 121.322840 48.100505 84.572840 178.350505 121.322840</float_array> 
             <technique_common> 
             <accessor source="#mesh1-geometry-uv-array" count="24" stride="2"> 
              <param name="S" type="float" /> 
              <param name="T" type="float" /> 
              </accessor> 
              </technique_common> 
              </source> 
            
            
            
            <source id="mesh1-geometry-position"> 
              <float_array id="mesh1-geometry-position-array" count="24">178.350505 121.322840 0.000000 48.100505 84.572840 0.000000 48.100505 121.322840 0.000000 178.350505 84.572840 0.000000 178.350505 84.572840 12.000000 178.350505 121.322840 12.000000 48.100505 121.322840 12.000000 48.100505 84.572840 12.000000</float_array> 
             <technique_common> 
             <accessor source="#mesh1-geometry-position-array" count="8" stride="3"> 
              <param name="X" type="float" /> 
              <param name="Y" type="float" /> 
              <param name="Z" type="float" /> 
              </accessor> 
              </technique_common> 
              </source> 
            
            
            
            <source id="mesh1-geometry-normal"> 
              <float_array id="mesh1-geometry-normal-array" count="18">0.000000 0.000000 -1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 1.000000</float_array> 
             <technique_common> 
             <accessor source="#mesh1-geometry-normal-array" count="6" stride="3"> 
              <param name="X" type="float" /> 
              <param name="Y" type="float" /> 
              <param name="Z" type="float" /> 
              </accessor> 
              </technique_common> 
              </source> 
            
            
            <triangles material="FrontColorNoCulling" count="12"> 
              <input semantic="VERTEX" source="#mesh1-geometry-vertex" offset="0" /> 
              <input semantic="NORMAL" source="#mesh1-geometry-normal" offset="1" /> 
              <input semantic="TEXCOORD" source="#mesh1-geometry-uv" offset="2" set="0" /> 
              <p>0 0 0 1 0 1 2 0 2 1 0 1 0 0 0 3 0 3 0 1 4 4 1 5 3 1 6 4 1 5 0 1 4 5 1 7 0 2 8 6 2 9 5 2 10 6 2 9 0 2 8 2 2 11 1 3 12 6 3 13 2 3 14 6 3 13 1 3 12 7 3 15 1 4 16 4 4 17 7 4 18 4 4 17 1 4 16 3 4 19 4 5 20 6 5 21 7 5 22 6 5 21 4 5 20 5 5 23</p> 
              </triangles> 
            
            

            Have you found that the uv coordinates are so strange. I want to know how these coordiantes range is set. I want to use the texture coordinates in range of [0,1] that could be used in OpenGL. I have asked this questions in google sketchup forum for many time. One of them told me maybe this problem should be resolved in ruby or SDK. So could anyone give me some suggestions?
            Thank you.

            Mia

            1 Reply Last reply Reply Quote 0
            • R Offline
              remus
              last edited by

              Sorry, youve lost me πŸ˜‰

              Hopefully someone more knowledgeable will be able to answer your question.

              http://remusrendering.wordpress.com/

              1 Reply Last reply Reply Quote 0
              • W Offline
                Whaat
                last edited by

                I read somewhere that the UVs for a texture that is applied to a group or component are multiplied by the texture size. That would explain the odd range in UV coordinates. Try dividing them by the texture width and texture height values.

                SketchUp Plugins for Professionals

                1 Reply Last reply Reply Quote 0
                • F Offline
                  freesui1984
                  last edited by

                  @remus said:

                  Sorry, youve lost me πŸ˜‰

                  Hopefully someone more knowledgeable will be able to answer your question.

                  but do you find that value in texture coordinates have something with like the vertex coordinates?
                  Following your advice, should i divide width or height of texture image?

                  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