Modeling Question.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/09/2010 at 12:02, xxxxxxxx wrote:
Howdy,
Hehehe, well take a good look at these 2 lines:
PolyInfo *pli = NULL; if (!pli) return FALSE;
... can you say DOH!
Hey, I've been there; done that; before, too.
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/09/2010 at 12:06, xxxxxxxx wrote:
LOL.. HAHAHAHAHA. So basically I set it to nothing and then check if it's nothing. HAHAHAH I'm a genious. Thanks Dan.
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/09/2010 at 12:08, xxxxxxxx wrote:
What do I initialize pli to? for a Polyinfo ?
Could I do
PolyInfo *pli = new PolyInfo;
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/09/2010 at 12:16, xxxxxxxx wrote:
hmmmm.. . I am initializing it before it's used with ..
pli = n.GetPolyInfo(i);
Why am I getting an error that it's not initialized.. That's weird
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/09/2010 at 12:18, xxxxxxxx wrote:
problem solved.. I just initialized it first with
n.GetPolyInfo(0)
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/09/2010 at 12:46, xxxxxxxx wrote:
One more question, Is there a way to reindex the points in my object? I am creating a bunch of new points which are all indexed as they are added which makes the indices all over the place and when the geometry is created the shape looks crazy. The points are in the right spot but the indices are all over the place..
Thanks,
~Shawn
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/09/2010 at 07:43, xxxxxxxx wrote:
Howdy
Well, I think the modeling functions normally add new points to the end of the points array, and new polygons to the end of the polygons array.
It would be trivial to insert a point in the middle of an array. You'd simply create a new array sized to the new point count, copy the block of memory above the insertion position to the new array, then copy the block of memory below the insertion position to the new array but move it 1 position down in the array, and finally copy the new point into the insertion position of the array.
This would be fine if you're just dealing with points. But, since polygons only hold point indices, for each point you add, you'll have to loop through all of the polygons, checking their existing point indices and if any polygons have point indices greater than or equal to the index of the inserted point, you'll have to add +1 to those indices. This also would be trivial if the object only has a few polygons, but if you have a mesh with thousands of polygons, it could get costly.
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/09/2010 at 07:48, xxxxxxxx wrote:
Hey thanks for the reply Dan. I think this is gonna take a little investigating to figure out why I am getting the results I am. I have been reading through the3 Modeling Library documentation and am beginning to think it is more of a problem with the ngons.
see this thread:
https://developers.maxon.net/forum/topic/5210/5204_ngon
I think I need to divert my attention to ngons.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/09/2010 at 08:09, xxxxxxxx wrote:
Howdy,
Oh, OK I see. I misunderstood the question. I'm not really sure what's going on with that example in the other thread, as I haven't really delved too deeply into the modeling functions.
But, looking at your code again, I think you can do away with these lines:
PolyInfo *pli = n.GetPolyInfo(0); if (!pli) return FALSE;
... and simply change this:
pli = n.GetPolyInfo(i);
... to this:
pli = n.GetPolyInfo(i); if(!pli) continue;
... or this:
pli = n.GetPolyInfo(i); if(!pli) return FALSE;
EDIT:
Actually in c++ it doesn't take any more processor time to define a variable type within a loop, so you don't really need to define the variable outside the loop.You could do this:
PolyInfo *pli = n.GetPolyInfo(i); if(!pli) continue;
... inside the loop as long as the variable will only be used inside the loop.
Adios,
Cactus Dan -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/09/2010 at 12:49, xxxxxxxx wrote:
Thanks for the code improvement Dan. Anyone else know anything about manipulating ngons in C4D?
This thread is where my problem is located.
https://plugincafe.maxon.net/topic/5210/5204_ngon
In fact, I will stop posting on this Modeling thread now and go over there.