Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rotating faces to face the camera?

19 views
Skip to first unread message

Bint

unread,
Jan 28, 2013, 1:17:50 PM1/28/13
to
Hello,

I want to draw an antialised wireframe cube, with lines of a certain width
(greater than 1). In OpenglES 2, on my devices at least, this isn't
supported.

I've had some success drawing 2D antialiased lines, by using the trick of
drawing an extra rim of polygons along the edge, with the outermost vertices
transparent.

But if I were to do that in 3D, the polygons comprising a line would form a
flat ruler shape, and it would change depending on the angle I looked at it.
I was thinking I might be able to get it to work by rotating the polygons to
face the camera. Has anyone done that? Will it work to achieve what I want?

I think I would start with the 8 cube vertices. Then for each segment in the
cube, I would create two more vertices at each endpoint, extending
perpendicular to the segment on the plane facing the camera. Does that make
sense? Anyone know how to compute those?

Thanks
B

Nobody

unread,
Jan 28, 2013, 2:08:28 PM1/28/13
to
On Mon, 28 Jan 2013 12:17:50 -0600, Bint wrote:

> But if I were to do that in 3D, the polygons comprising a line would form
> a flat ruler shape, and it would change depending on the angle I looked at
> it. I was thinking I might be able to get it to work by rotating the
> polygons to face the camera. Has anyone done that? Will it work to achieve
> what I want?

Personally, I'd do this in the geometry shader, after the coordinates have
been transformed to screen space.

The main problem with doing it in model space is that the offset needs to
vary with distance in order to get a constant thickness in screen space.

Also, if one of the endpoints is closer to the vanishing point than half
the line thickness, the polygon would have to extend beyond infinity. But
that's an issue even if you do it in screen space. The solution is to fold
the endpoints out so that they're perpendicular to the projection plane.

Bint

unread,
Jan 28, 2013, 2:31:35 PM1/28/13
to
OpenGLES 2 doesn't have geometry shaders, does it? At least not on iOS
which I am using.

B

sophie

unread,
Mar 28, 2013, 12:28:05 PM3/28/13
to
Tchao.

this extract is appropriate
However, when you draw a portrait from life, a
more accurate approach to drawing is needed.
;
Notwithstanding that, it should be useful to talk about the data management of the drawing
accurately considering the cube with the drawing pretreatment;
Beyond this, you should also try
http://www.corporationwiki.com/Unknown/FRANCE/web3vector-llc/29117979.aspx
after analyzing the cube;
could you show me how to validate the cube monitoring and its relationship with the drawing fine tuning?

When considering the cube , you may look at this site http://www.corporationwiki.com/Unknown/FRANCE/web3vector-llc/29117979.aspx
Best regards
0 new messages