Hi everybody!
I am developing a new version of a program using SketchUp SDK 2014, old version of this program used SkpWriter 8.
I have a issue with create faces on SDK 2014. I am using this code to create faces:
From your figure it appears that Faces are reversed in the new version? In current versions, the “outside” direction is determined by the order in which you list the vertices when you create it. If they appear to go around the perimeter counterclockwise as you look at the face, you are looking from the “outside”. You can either reverse the ordering of the vertices in the problem faces or reverse the face normal after you create it.
Thanks for answer!
I can’t change order of vertices list(in the example I set them manually, but in real program I get them from outside). How can I detect this(order in counterclockwise or clockwise?) in my program to make reversing this face(or change order if it’s possible)?
There is more than just the reversed faces - it appear that they do not merge. Got a more complete example? @bugra or @Paul - go any idea why the faces doesn’t merge?
Hi
I’m solved issue of reversing faces with back initialization of vertices.
Now faces is displayed correctly. But I have a new issue with displaying of textures. Texture hidden by side of cube.
That looks like Z fighting because you have faces overlapping on the exact same plane.
Without knowing what you did with the old SDK I’m not sure what the source of the difference you experience.
Thanks for this example. I’ll need to poke about a bit to see what’s going on. The old C++ SDK was deprecated before I started working here so I need to dig up some history.
Sorry for the delay, but we need to dig deeper into this. I’m filing a few issues in our tracker for a few things in this thread. I’ll try to post back with info, but right now I don’t have an immediate answer.
One thing, have you tried SUFaceCreate instead of SUFaceCreateSimple?
Yes, I create side of cube(with SUFaceCreate or SUFaceCreateSimple), than I create textured face on this side with SUGeometryInputAddFace
Yuo canchek this in source
You shouldn’t create a face to go on top of another simply to add a texture. Create the face once, then apply the material to that face. Otherwise you will end up with these z-fighting issues.
We’ve identified a problem with the new API. Then you use SUFaceCreate* and then SUEntitiesAddFaces it currently doesn’t merge the entities like the previous version did. This is a big issue and we’ll be addressing that in a future release.
But as is is now, you want to use SUGeometryInput to make sure vertices are merged.