Object multiple faces

No trouble at all. I want to help people get into scripting. I think it is a pretty neat and under-used feature of 3DC. The results can potentially benefit everyone (new useful scripts). I think what we need here is better documentation of the 3DC methods. One day…

The crease angle for GenerateNormals is the angle between faces that should be rendered as a andquot;creaseandquot;. With 3DC I use a value of 1 as a default.

Richard

Richard,
I can use scripts to create a single objects with a single face. I am having trouble creating a single objects with multiple faces. andnbsp;The objects seems unstable (crashes 3DC if moved) or it does not create all the faces. andnbsp;I am trying to create objects like cylinder primitive where there are multiple faces but it is all one object. The question is when using the face object, should the additional faces be part of the same or separate AddPointsandNormal array?

Thanks GeoJenner. andnbsp;It just seems as if when I put multiple faces in the same array of points, the object is unstable or all the faces are not generated. andnbsp;I know there is no problem with my algorithm since I can generate each face as it’s own object(i.e. each face gets its own point array). andnbsp;I am not sure if I need do dummy normals for each face in the point array or one dummy normal and let the function AddPointsandNormal add the rest of the normals. andnbsp; Neither method seems to perform well.

faces and points are both added separately to the object you’re creating.

you can add points to the object andnbsp;- say you add 10 points. andnbsp;you then add faces. andnbsp;the points in the faces have to refer to the array from 0 to 9 that represent your points. andnbsp;

is that any clearer?

George

No, there is no need for a tiny gap. I just mean if you have a triangle that has two or three points in the same location (and especially with the same point index) you may find that Direct3D doesn’t like it and crashes. If you were to leave a really tiny gap, the mathematics of 3D would make it so at certain viewing angles you would be able to see cracks between faces. Something you definitely don’t want.

Richard

I would use a single dummy normal and use the andquot;generatenormalsandquot; method afterwards.

If 3DC becomes unstable after creating faces, it is likely there is something about the faces that Direct3D really doesn’t like. Usually this is a null face (one with no points). Or a face that is just a line, or a face that is a series of points all with the same index value, or a face that has two or more consecutive identical vertices etc.

Richard

Richard,
Glad you are back! andnbsp;Does this mean when generating a cylinder with andnbsp;faces that share the same edge and vertices, that the vertices should differ by some small number (.001)?

I am confused about GenerateNormals. andnbsp;I did not use the crease operation to generate the faces of the object. andnbsp;So I don’t know what a crease angle would be or even what it is relative to. andnbsp;I established a face and created points using AddPointsandNormals. Do replace the line of code of AddPointsandNormals with the lines of code AddPoints and GenerateNormals. andnbsp;And what is the the crease angle? andnbsp;I feel as if I am bothering you with too detailed questions. andnbsp;If this information is in a book somewhere as it relates to directly to 3DC let me know. andnbsp; andnbsp;

Speaking of the andquot;galleryandquot;, I am a tad behind. I was on holidays for a few weeks after 5.0 was sent out. There should be some new ones this week, hopefully.

Richard

I will try this. andnbsp;

Yes the scripting is an under appreciated feature of 3DC. andnbsp;I used the scripting to build my coal mine for MSTS. andnbsp; It allowed exact postioning and sizing of faces. andnbsp;I was hoping to post it in your gallery soon.

You must be logged in to reply in this thread.

10 posts