Point object (without polygons)

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 17/05/2007 at 08:44, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   9.6 
Platform:   Windows  ;   
Language(s) :   C.O.F.F.E.E  ;

---------
Hello,

How Can I simple create a object only with points (no polygons)?

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/05/2007 at 02:18, xxxxxxxx wrote:

Here is a script that creates an points-only object (a sine curve). Have a look at the comments and the COFFEE docu.

  
var op = AllocObject(Opolygon);  
if(!op) return;  
  
var vc = new(VariableChanged); if (!vc) return FALSE; //VariableChanged is needed for changing the point count  
var cnt = op->GetPointCount();  
vc->Init(cnt,100);  
op->MultiMessage(MSG_POINTS_CHANGED,vc);  
  
var n=0;  
var points = op->GetPoints();  
cnt = op->GetPointCount();  
for(n=0; n<cnt; n++) //iterating over the point array and changing of the point values  
{  
     points[n] = vector(n,10.0*sin(float(n/float(cnt))*pi2),0);  
}  
  
doc->StartUndo();  
doc->AddUndo(UNDO_OBJECT,op);  
op->SetPoints(points); //write the point array back to the object  
op->Message(MSG_UPDATE);  
doc->AddUndo(UNDO_OBJECT_NEW,op);  
doc->InsertObject(op,NULL,NULL);  
doc->EndUndo();  

cheers,
Matthias

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 18/05/2007 at 04:04, xxxxxxxx wrote:

thx, works fine ! 🙂