Rafa
Rafa

Reputation: 403

drawing a rectangle with min3d in android

I am using the 3d framework min3d and am trying to draw a rectangle that covers the whole screen. What parameters should I pass to the constructor of the Rectangle class?? It is declared this way:

public Rectangle(float $width, float $height, int $segsW, int $segsH, Color4 color)

I don't see what are segsH and segsW for. I can't see any doc about the constructor.

Upvotes: 0

Views: 695

Answers (2)

slamnjam
slamnjam

Reputation: 180

It appears segsW and segsH control how many triangles are used to draw the rectangle.

Upvotes: 0

Rafa
Rafa

Reputation: 403

I got it, it didn't have anything to do with those parameters. By default the rectangle is drawn completely perpendicular to the screen so you can't see it. If you want to see it with the same dimensions you drew it you have to rotate it in y axis. Example:

rect = new Rectangle(1, 1, 2, 2,new Color(255,0,0,255));
rect.rotation().y = 180;
rect.lightingEnabled(false);
scene.addChild(rect);

In case this is usefull for someone else =)

Upvotes: 1

Related Questions