How to connect PC and Mac directly via Wi-fi?
2,003
Setup an Ad-Hoc network, one system, join it from the other.
First system setup:
- OSX http://www.dummies.com/how-to/content/how-to-set-up-an-ad-hoc-wireless-network.html
- Windows http://technet.microsoft.com/en-us/magazine/dd296746.aspx
Related videos on Youtube
![Brieg](https://i.stack.imgur.com/XVJz2.jpg?s=256&g=1)
Author by
Brieg
Updated on September 18, 2022Comments
-
Brieg almost 2 years
How to draw circle or semi circle or arc from start(B) to end(C) point giving(without using any external library) in pure C# and OpenGL :
- A(Ax,Ay) - polyline
- B(Bx,By) - start point
- C(Cx,Cy) - end point
- M(Mx,My) - center of circle or semi circle or arc
- r - radius
- startAngle = atan2(B.y - M.y, B.x - M.x) - in radians
- endAngle = atan2f(C.y - M.y, C.x - M.x) - in radians
- segments = 80
Unknow values:
- clockwise or anticlockwise direction
Requirements
- Arc must be drawing from point B to C
Can someone please provide me equation for drawing an arc in OpenGL?
Hint:
Will it be a circle, a semicircle or arc it depends on the position of the center of the circle and the start and end points.
Please give me a some light to solve this.
-- EDIT --
Below i present the solution. But it draw sometimes in wrong direction (should clockwise but it draw anticlockwise).:
float startAngle = atan2(B.y - centerArc.y, B.x - centerArc.x); float endAngle = atan2(C.y - centerArc.y, C.x - centerArc.x); if (endAngle < startAngle) { endAngle += 2.0f * PI; } glBegin(GL_LINE_STRIP); for (float angle = startAngle; angle <= endAngle; angle = angle + 0.01f) { float x = centerArc.x + cos(angle) * r; float y = centerArc.y + sin(angle) * r; glVertex2f(x, windowHeight - y); } glEnd();
-
BDL almost 8 yearsHaven't you asked the same question several times?
-
Brieg almost 8 yearsIn Java or Android with ready libraries, yes.
-
Unick almost 8 yearsTry to call glDisable​(GL_CULL_FACE) before render. Maybe it is turned on by default.
-
Nicol Bolas almost 8 years"Semi circle have to be bottom of the line and not on the top." Bottom relative to what? Lines do not have a "bottom" or a "top". So how do you determine which side of the line you want the arc drawn on?
-
Martijn Pieters almost 8 yearsPlease don't vandalise your post please.
-
BDL almost 8 yearsI do not exactly understand what you mean.
-
BDL almost 8 yearsI see. The problem is, that the angles are in range from -pi to pi and you are not taking that into account. The easiest thing is to move add 2*pi to the angle when it is negative.
-
BDL almost 8 yearsExchanging B and C should do the trick. When B->C is the counter-clockwise part, then C->B will be the other direction.
-
BDL almost 8 yearshow do you even know which orientation you want? Your problem is under-determined when not fixing the orientation. Unless you have any other constraint to determine the direction, I don't see any way how to do this. And it would make the world for both of us easier when you start with the full set of information on first place.
-
BDL almost 8 yearsAs already said: From the data you have, you will not be able to conclude which orientation is the right one. You could decide it depending on the line segment before the arc starts, but this would require at least on additional point.
-
Brieg almost 8 yearsPlease remove this topic. Thx.