Solved

# Drawing a Quad Polygon strating from a 3d Line entity.

Posted on 2005-04-26
402 Views
I need to draw a Quad shape starting from a Line expressed in 3d points structure data (x,y,z).
I need to find the normals of the line ( with an angle of 90.0 degrees), and intersect them with a given height. In this way i could find the other 2 vertices and able to draw the quad. I will use this procedure to find the trajectory of a circular Blade, cutting a solid.

Is there some experts that could help me?
0
Question by:Filae

LVL 3

Expert Comment

0

Author Comment

Ive resolved the proble on my own, sorry for the inconvenience:

I proceed in this way:

I find the Alfa angle:

Alfa = atan(y2-y1/x2-x1)

Then i find the other two vertices of the quad.

x3 = x1 - r sin Alfa
y3 = y1 + r cos Alfa
x4 = x2 - r sin Alfa
y4 = y2 + r cos Alfa

0

LVL 8

Expert Comment

Are you trying to create a quad in a circle?

corey
0

Author Comment

No, im building several circles rapresenting a blade track, with several polys that interpolate the circles. If there was a space for images on this site, i would be able to clarify me better.. sorry...
0

LVL 22

Expert Comment

You can do this without any trig, and without the risk of division-by-zero (if we can assume that x1 != x2 or y1 != y2).

dx = x2 - x1
dy = y2 - y1
scale = sqrt(dx*dx + dy*dy)/r
xoff = -scale*dy;
yoff = scale*dx;
x3 = x1 + xoff;
y3 = y1 + yoff;
x4 = x2 + xoff;
y4 = y2 + yoff;
0

LVL 22

Expert Comment

With points refunded?  Several people answered his question.
0

LVL 20

Expert Comment

"Ive resolved the proble on my own, sorry for the inconvenience:" and posting a solution right after this...two months before your answer. :)

It is a self answered question.

Venabili
0

Accepted Solution

PAQed with points refunded (125)

modulo
Community Support Moderator
0

## Featured Post

### Suggested Solutions

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Recently, in one of the tech-blogs I usually read, I saw a post about the best-selling video games through history. The first place in the list is for the classic, extremely addictive Tetris. Well, a long time ago, in a galaxy far far away, I was…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…