THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 13/10/2009 at 15:53, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11
Platform: Windows ;
Language(s) : C++ ;
---------
Hello I am currently using Polygon3D to create a visual aid in my plugin. I was wondering if someone could tell me how I would use DrawPoly to accomplish the same task?
Here is the code I use that uses Polygon3D()
Here's the declarations and such.
> `
\> BaseContainer *bc=((BaseList2D* )tag)->GetDataInstance();
\> LONG lngMySymPlane =tag->GetDataInstance()->GetLong (SYMMETRY_PLANE);
\> LONG lngMirroredSide = tag->GetDataInstance()->GetLong(MIRRORED_SIDE);
\> LONG trans = 100;
\> LONG boxTrans = 200;
\> Vector color = bc->GetVector(PLANE_COLOR);
\> Vector boxColor = bc->GetVector(BOX_COLOR);
\> Real size;
\> size = .60;
\>
\> //Matrix for determining scale, rotation, and position.
\> Matrix m = op->GetMg();
\> Vector rad = op->GetRad();
\>
\> m.v1 *= rad.x+rad.x;
\> m.v2 *= rad.y+rad.y;
\> m.v3 *= rad.z+rad.z;
\>
\>
`
Here is one of the times that Polygon3D is called.
> `
\>
\> if (tag->GetDataInstance()->GetBool(SHOW_PLANE)) // If SHOW_PLANE is checked, then draw the polygon.
\> {
\>
\> Vector p[4];
\>
\> p[0] = Vector(-1,1,0);
\> p[1] = Vector(1,1,0);
\> p[2] = Vector(1,-1,0);
\> p[3] = Vector(-1,-1,0);
\>
\>
\> p[0] = p[0] * m;
\> p[1] = p[1] * m;
\> p[2] = p[2] * m;
\> p[3] = p[3] * m;
\>
\> Vector f[3] = { Vector(color),Vector(color),Vector(color)};
\>
\> bd->SetLightList(BDRAW_SETLIGHTLIST_NOLIGHTS);
\> bd->SetTransparency(trans);
\> bd->Polygon3D(p,f,TRUE);
\>
\>
\>
\> return true;
\> }
\>
\>
\>
`
I would like to try to use DrawPoly fo this because the results I get from Polygon3D are not quite as good as I had hoped.. There are a lot of shading issues.
Any help would be greatly appreciated.
Thanks,
~Shawn