THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 05/10/2009 at 18:24, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 11
Platform: Windows ;
Language(s) : C++ ;
---------
Hello,
I am creating a box that I would like to be created to be half of the size of an existing cube. I am using Box3D to draw the box and I would like to resize the newly drawn box so that it covers half of the box.
Here is the code I am using to draw the box.
> `
\>
\>
\> Bool TrueSymmetry::Draw(PluginTag *tag, BaseObject *op, BaseDraw *bd, BaseDrawHelp *bh)
\> {
\> //GePrint("Draw");
\> BaseContainer *bc=((BaseList2D* )tag)->GetDataInstance();
\> LONG lngMySymPlane =tag->GetDataInstance()->GetLong (SYMMETRY_PLANE);
\> LONG trans = 175;
\> LONG boxTrans = 200;
\> Vector color = bc->GetVector(PLANE_COLOR);
\> Vector boxColor = Vector(1,0,0);
\> Real size;
\> size = .55;
\>
\> //Matrix for determining scale, rotation, and position.
\> Matrix m = op->GetMg();
\> Vector rad = op->GetRad();
\>
\> m.v1 *= rad.x+100;
\> m.v2 *= rad.y+100;
\> m.v3 *= rad.z+100;
\>
\>
\>
\> switch (lngMySymPlane)
\> {
\>
\> case XY_PLANE:
\>
\> if (!tag->GetDataInstance()->GetBool(ENABLE_SYMMETRY))
\> {
\> bd->SetTransparency(boxTrans);
\> Vector p[8];
\>
\> p[0] = m * Vector(-size, -size, -size);
\> p[1] = m * Vector( size, -size, -size);
\> p[2] = m * Vector( size, -size, size);
\> p[3] = m * Vector(-size, -size, size);
\> p[4] = m * Vector(-size, size, -size);
\> p[5] = m * Vector( size, size, -size);
\> p[6] = m * Vector( size, size, size);
\> p[7] = m * Vector(-size, size, size);
\>
\> bd->Box3D(m,size,boxColor);
\> }
\>
\>
\>
`
The problem is, that when I draw the box, if I change the vectors under p[] it doesn't change the location of each point of the box? Could someone explain to me how to alter the position of the box and to make it more of a rectangle shape so that it covers onnly half of the cube in the viewport.
Thanks,
~Shawn