עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

יצירת Solid Ellipse ב- OpenGL

Featured Replies

פורסם

היי כולם,

אני צריך עזרה בציור של אליפסה מלאה בתיכנות בשפת C ב- OpenGL.

אם מישהו מכיר אתר שמסביר איך עושים את זה, או אם יש פונקציה מובנית שעושה את זה

זה יהיה מצויין.

עד עכשיו מצאתי איך עושים אליפסה חלולה רק עם קו מיתאר וגם לא הצלחתי למצוא איך אני ממקם את האליפסה

על המסך איפה שאני רוצה.

האליפסה מופיע לי על ראשית הצירים.

זאת הפונקציה שהשתמשתי בה (המרצה שלי שלח לי אותה):


void DrawEllipse(float xradius, float yradius)
{
glBegin(GL_LINE_LOOP);

for (int i=0; i <= 360; i++)
{
//convert degrees into radians
float degInRad = i*DEG2RAD;

glVertex2f(cos(degInRad)*xradius,sin(degInRad)*yradius);

}
glEnd();
}

תודה לעוזרים...

פורסם

שים לב שהפונקציה glVertex2f מקבלת שני פרמטרים - קואורדינטת x וקואורדינטת y. על מנת להזיז את האליפסה את פשוט צריך להזיז את הערכים האלה.

פורסם

תשתמש בסיפריית GLUT

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.