sketchucation logo sketchucation
    • Login
    1. Home
    2. giuseppe500
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    G
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 8
    • Posts 12
    • Groups 1

    giuseppe500

    @giuseppe500

    10
    Reputation
    1
    Profile views
    12
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    giuseppe500 Unfollow Follow
    registered-users

    Latest posts made by giuseppe500

    • Unique texture

      hello.
      Is possible in sketchup make all the used texture an unique texture?
      like a texture atlas ?
      Or i must do it in a plugin?

      posted in Developers' Forum
      G
      giuseppe500
    • RE: Importer in the same wind order

      thanks TIG.
      Now i must find a method for import all faces in correct wing order:
      1)i see that there is a m_pMesh->GetPolygonPointIndex(m_nCurrPoly+1, m_nCurrPoint+1, &m_idx);
      is sufficent have the correct indexes of the vertexes for import all in the correct windorder ?
      2) or i must separate the importation of vertexes like the sketchup example SkpToXml of the sdk?
      The sample project do that:
      extract the loops

      hr = pFace->get_Loops(&pLoops);
      long nLoops;
      hr = pLoops->get_Count(&nLoops);

      //If this is a simple face (no loops)
      if (nLoops==1){/////////////////////////////////////////////////////////////////is a simple face
      //import vertex in counterclockwise order

      CComPtr<ISkpLoop> pLoop;
      hr = pFace->get_OuterLoop(&pLoop);
      CComPtr<ISkpVertices> pVerts;
      hr = pLoop->get_Vertices(&pVerts);
      }
      else ///////////////////////////////////////////////////////////////////is a complex face tessellate it with:

      pFace->CreateMeshWithUVHelper(3, pUVHelper, &pMesh);
      and imports vertex in clockwise order?????
      //there i must place the m_pMesh->GetPolygonPointIndex??? and import in specific order????
      ecc....

      is sufficent????

      Thanks a lot.

      posted in Developers' Forum
      G
      giuseppe500
    • Importer in the same wind order

      hello.
      I'm trying to finish a sketchup importer for opengl in c++ .
      My problem is that the shaders that represent the materials of sketchup are five:
      1)front color back color
      2)front color back texture
      3)texture front, back color
      4)double color
      5)double texture.

      in these shaders i use the gl_frontfacing (that return true if the face is front and false if the face is back )for draw the different materials.
      For example ,in case 2: in the pixel shader:

      if(gl_frontFacing)
      {
      gl_color = frontColor
      }
      else
      {
      gl_color = texture color
      }

      ecc...

      I see that the gl_frontFacing return true if the vertexes are in counterclockwise order or the opposite, i'm not remember good, The problem is that in my importer i have some faces that are counterclockwise and others that are clockwise , then i get a wrong model.
      I think that the problem is the indexes order of the vertexes , how i can get all the faces in an unique wind order?
      thanks.

      posted in Developers' Forum
      G
      giuseppe500
    • Face material not set

      hello.
      I created a sketchup importer in c++ for opengl.
      I have a problem:
      Is possible to know if a face material is not set?
      Whitout read his color?
      For exemple if i set a texture on a face in front texture , and nothing on back face,is possible to know this "not set" material?
      with the c++ sdk.
      thanks.

      posted in Developers' Forum
      G
      giuseppe500
    • RE: Gui api in sketchup

      If i can make a c++ extension(i don't know how) i can call c++ functions from the ruby gui!
      is possible?
      How i can make a c++ extension ?
      There is some documentation or specifics?

      Thanks

      posted in Developers' Forum
      G
      giuseppe500
    • Gui api in sketchup

      hello.
      Is possible to use some gui(graphical user interface) in sketchup ?
      and is possible to program the gui in c++ ?
      I wish find some plugin that do this for see how to do in c++ sources.
      What do you advice to me ?
      only opensurce clearly.

      Thanks.

      posted in Developers' Forum
      G
      giuseppe500
    • RE: Reverse face and uv

      I don't have really clear what are the difference between faces and reversed faces, so in my importer i use an atlas and I calculate the new uv with an

      newU = abs(U) * scaleMatrixU + offsetU;
      newV = abs(V) * scaleMatrixV + offsetV;

      and this in non reversed face seems correct , the problem is when i have a reverse face , the texture UV are wrong .

      if i don't use the abs the UV are wrong at all both in reversed that in non reversed faces.

      But what mean a negative U or a negative V in sketchup?
      is a form of tile or wrap?
      I not understand

      thanks.

      posted in Developers' Forum
      G
      giuseppe500
    • Reverse face and uv

      Hello.
      I'm creating a sketchup importer in c++ and opengl.
      I have a problem with th UV mapping.
      I see that in sketchup the uvs can be positive or negative , and if i reverse a face the UV changes , but is not only inverted the sign , whats changes and how i can import it in opengl system UV.

      posted in Developers' Forum
      G
      giuseppe500
    • Uv c++ and sketchup

      hello.
      I 'm creating a shetchup importer ,that use a texture atlas .
      I'm a beginner and i wouldn't go inside the jungle of wrap/tile of texture atlas custom shaders.
      my problem now is to recognize what are wrapped/tiled and what are not for process without atlas the tiled/wrapped textures.
      I'm creating this function in c++:

      
      bool CMesh;;IsTiled()
      {
              std;;vector<TEXCOORD*>;;iterator itBegin =      m_vTextureCoord.begin();
              std;;vector<TEXCOORD*>;;iterator itEnd =        m_vTextureCoord.end();
      
              for(;itBegin != itEnd; itBegin++)
                      if(abs((*itBegin)->U) >1 || abs((*itBegin)->V) >1)
                      return true;
              
              if(m_pMaterial->GetTypeMaterial() == eTextureDouble){
                      std;;vector<TEXCOORD*>;;iterator itBegin =      m_vTextureCoordBack.begin();
                      std;;vector<TEXCOORD*>;;iterator itEnd =        m_vTextureCoordBack.end();
      
                      for(;itBegin != itEnd; itBegin++)
                              if(abs((*itBegin)->U) >1 || abs((*itBegin)->V) >1)
                              return true;
              }               
              return false;
      }
      
      

      but i see that this is wrong:

      abs((*itBegin)->U) >1

      i removed the abs():

      if( ((*itBegin)->U) >1 || ((*itBegin)->U) <0)
      return true;//is tiled/wrapped

      the problem is that i have some texture UV of U = -0.4 V = 0.2 and with a simple atlas algorithm it work fine !
      why?
      the texture UV don't be from 0 to 1 ?

      this is the code for read from sketchup api the uv:

      
              m_pApi->ImportVertexUV(&fu, &fv, &fw, &fub, &fvb, &fqb);
              TEXCOORD *ptUV = new TEXCOORD;
              ptUV->U = fu  ;
              ptUV->V = 1- fv ;//this is added from me without explanations , only 
      for ;"so 'works"  BAD!!!!
              
              ptUV->W = fw;
              
              vVectorUV.push_back(ptUV);
      
      //ecc...
      //ecc...
      
      

      how i can recognize uv and wrapped texture?
      I heard that sketchup does not normalizes the coordinates uv, is it possible?
      how do I normalizing if this is the problem?

      thanks.

      posted in Developers' Forum
      G
      giuseppe500
    • RE: Sketchup front back face

      thanks tig.
      I understand, you were very kind, but I just can not find property Normal.
      I'm Using sketchup 8 and C + +, perhaps in the 'SDK for C + + is called in another way.
      can 'be?
      else:
      I have seen examples in the SDK that tests if the loops are == 1, and the commentary says it is a simple face, if not then use the "== 1" it use the
      "CreateMesh (PolygonMeshPoints | PolygonMeshNormals, m_pPerspective, & m_pMesh);"
      in this case the faces are always counter-clockwise or do I need to know the normal property ?
      I see that there is a property get_Plane, i can use this?
      but how?
      thanks.

      ps sorry for my english

      posted in Developers' Forum
      G
      giuseppe500