Переписати код пайтон
11 USDпереписати на сучасний OPENGL
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import math
light0_ambient = [0.2, 0.2, 0.2, 1.0]
light0_diffuse = [0.0, 0.0, 0.0, 1.0]
light1_diffuse = [1.0, 0.0, 0.0, 1.0]
light1_position = [1.0, 1.0, 1.0, 0.0]
light2_diffuse = [0.0, 1.0, 0.0, 1.0]
light2_position = [-1.0, -1.0, 1.0, 0.0]
s = 0.0
angle1 = 0.0
angle2 = 0.0
def output(x, y, text):
glPushMatrix()
glTranslatef(x, y, 0)
for char in text:
glutStrokeCharacter(GLUT_STROKE_ROMAN, ord(char))
glPopMatrix()
def display():
global angle1, angle2, s
amb = [0.4, 0.4, 0.4, 0.0]
dif = [1.0, 1.0, 1.0, 0.0]
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glEnable(GL_LIGHT1)
glDisable(GL_LIGHT2)
amb[3] = dif[3] = math.cos(s) / 2.0 + 0.5
glMaterialfv(GL_FRONT, GL_AMBIENT, amb)
glMaterialfv(GL_FRONT, GL_DIFFUSE, dif)
glPushMatrix()
glTranslatef(-0.3, -0.3, 0.0)
glRotatef(angle1, 1.0, 5.0, 0.0)
glCallList(1) # render ico display list
glPopMatrix()
glClear(GL_DEPTH_BUFFER_BIT)
glEnable(GL_LIGHT2)
glDisable(GL_LIGHT1)
amb[3] = dif[3] = 0.5 - math.cos(s * .95) / 2.0
glMaterialfv(GL_FRONT, GL_AMBIENT, amb)
glMaterialfv(GL_FRONT, GL_DIFFUSE, dif)
glPushMatrix()
glTranslatef(0.3, 0.3, 0.0)
glRotatef(angle2, 1.0, 0.0, 5.0)
glCallList(1) # render ico display list
glPopMatrix()
glPushAttrib(GL_ENABLE_BIT)
glDisable(GL_DEPTH_TEST)
glDisable(GL_LIGHTING)
glMatrixMode(GL_PROJECTION)
glPushMatrix()
glLoadIdentity()
gluOrtho2D(0, 1500, 0, 1500)
glMatrixMode(GL_MODELVIEW)
glPushMatrix()
glLoadIdentity()
# Rotate text slightly to help show jaggies.
glRotatef(4, 0.0, 0.0, 1.0)
output(200, 225, "This is antialiased.")
glDisable(GL_LINE_SMOOTH)
glDisable(GL_BLEND)
output(160, 100, "This text is not.")
glPopMatrix()
glMatrixMode(GL_PROJECTION)
glPopMatrix()
glPopAttrib()
glMatrixMode(GL_MODELVIEW)
glutSwapBuffers()
def idle():
global angle1, angle2, s
angle1 = (angle1 + 0.8) % 360.0
angle2 = (angle2 + 1.1) % 360.0
s += 0.05
glutPostRedisplay()
def visible(vis):
if vis == GLUT_VISIBLE:
glutIdleFunc(idle)
else:
glutIdleFunc(None)
def main():
global angle1, angle2, s
glutInit()
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH)
glutCreateWindow("blender")
glutDisplayFunc(display)
glutVisibilityFunc(visible)
glNewList(1, GL_COMPILE) # create ico display list
glutSolidIcosahedron()
glEndList()
glEnable(GL_LIGHTING)
glEnable(GL_LIGHT0)
glLightfv(GL_LIGHT0, GL_AMBIENT, light0_ambient)
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_diffuse)
glLightfv(GL_LIGHT1, GL_DIFFUSE, light1_diffuse)
glLightfv(GL_LIGHT1, GL_POSITION, light1_position)
glLightfv(GL_LIGHT2, GL_DIFFUSE, light2_diffuse)
glLightfv(GL_LIGHT2, GL_POSITION, light2_position)
glEnable(GL_DEPTH_TEST)
glEnable(GL_CULL_FACE)
glEnable(GL_BLEND)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glEnable(GL_LINE_SMOOTH)
glLineWidth(2.0)
glMatrixMode(GL_PROJECTION)
gluPerspective(40.0, 1.0, 1.0, 10.0)
glMatrixMode(GL_MODELVIEW)
gluLookAt(0.0, 0.0, 5.0,
0.0, 0.0, 0.0,
0.0, 1.0, 0.0)
glTranslatef(0.0, 0.6, -1.0)
glutMainLoop()
return 0
if __name__ == "__main__":
main()
-
фігню якусь робить
-
Автоматичний переклад, дивиться оригінальний текст.
-
Current freelance projects in the category Python
Data parsing through mobile APILooking for a person with experience in data parsing through mobile API, for parsing e-commerce, rozetka and similar sites. Tasks: 1. Intercepting traffic from the mobile application (Android), setting up a proxy, analyzing requests. 2. Identifying the necessary API endpoints… Python, Data Parsing ∙ 7 hours 41 minutes back ∙ 18 proposals |
Creation of a multifunctional bot in Telegram
22 USD
(I will provide all materials in private messages) Here is a detailed project description: After pressing the button /start The bot sends a text with rules and terms of use (under the text, the button ‘acknowledged’) After pressing the button, the next message is… Python, Bot Development ∙ 3 days 3 hours back ∙ 95 proposals |
Find a product feed (Google Merchant XML) for a website on OpenCart
16 USD
It is necessary to find a direct link to the active product feed (XML) of a competitor for Google Merchant Center Platform (CMS): OpenCart / ocStore Find the original feedRequirements for the result: Working link to the XML file Python, Data Parsing ∙ 5 days 16 hours back ∙ 28 proposals |
Development of a TikTok farm (content factory)It is necessary to develop a system for centralized management of multiple TikTok accounts with automatic content publishing, using individual proxies and simulating natural account activity. Functional Requirements1. Account Management Adding and removing TikTok accounts.… Python, Bot Development ∙ 6 days 4 hours back ∙ 21 proposals |
Improve the performance of Claude Code and work on software development.I am currently developing CRM and Analytics software. I am using Claude Code, but I understand that the results are not the best in terms of changes. There are 2 tasks - Need help creating a preset for skills, MD, and so on to improve quality. Take verified ones that have been… AI & Machine Learning, Python ∙ 6 days 10 hours back ∙ 28 proposals |