PyOpenGl or pyglet - anycodings

文章推薦指數: 80 %
投票人數:10人

PyOpenGl or pyglet? I am looking to do some tinkering with anycodings_pyglet openGL and ... ANYCODINGS.COM ☰ Home Categories HTML Javascript CSS ReactJs AboutUs ContactUs PrivacyPolicy Terms&Conditions ☼ ☾ PyOpenGlorpygletQuestions:PyOpenGlorpyglet2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00699 Iamlookingtodosometinkeringwithanycodings_pythonopenGLandPythonandhaven'tbeenabletoanycodings_pythonfindgoodreasonsforusingPyOpenGlversusanycodings_pythonpyglet Whichwouldyourecommendandwhy? Admins PYTHONPYGLETPYOPENGLTotalAnswers9 33 Answers1:ofPyOpenGlorpyglet AsTonysaid,thisisreallygoingtoanycodings_pythondependonyourgoals.Ifyou'reanycodings_python"tinkering"totrytolearnaboutOpenGLanycodings_pythonor3DrenderingingeneralthatIwouldanycodings_pythondispensewithallpleasantriesandstartanycodings_pythonworkingwithPyOpenGL,whichisascloseanycodings_pythonareyou'regoingtogetto"raw"3Danycodings_pythonprogrammingusingPython. Ontheotherhand,ifyou're"tinkering"anycodings_pythonbywayofmockingupagameoranycodings_pythonmultimediaapplication,ortryingtoanycodings_pythonlearnaboutprogrammingpracticesinanycodings_pythongeneralthanPygletwillsaveyoulotsanycodings_pythonofup-frontdevelopmenttimebyanycodings_pythonprovidinghooksforinputevents,anycodings_pythonsounds,text/billboarding,etc.Often,anycodings_pythonthisup-frontinvestmentiswhatanycodings_pythonpreventspeoplefromcompletingtheiranycodings_pythonprojects,sohavingitdoneforyouisanycodings_pythonnotsomethingtobeignored.(Itisanycodings_pythonalsoveryPythonictoavoidreinventinganycodings_pythonthewheel.) Ifyouarelookingtodoanysortofanycodings_pythonheavy-dutylifting(whichnormallyfallsanycodings_pythonoutsidemydefinitionof"tinkering",anycodings_pythonbutmaybenotifyou'retinkeringwithanycodings_python3Denginedesign)thenyoumightwanttoanycodings_pythontakealookatPython-Ogre,whichwrapsanycodings_pythontheveryfull-featuredandrobustOGREanycodings_python3Dgraphicsengine. 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink mRahman 2 Answers2:ofPyOpenGlorpyglet Startwithpyglet.Itcontainsthebestanycodings_pythonhigh-levelAPI,whichcontainsallyouanycodings_pythonneedtogetstarted,fromopeningaanycodings_pythonwindowtodrawingspritesandOpenGLanycodings_pythonprimitivesusingtheirfriendlyandanycodings_pythonpowerfulSpriteandBatchclasses. Later,youmightalsowanttowriteyouranycodings_pythonownlower-levelcode,thatmakescallsanycodings_pythondirectlytoOpenGLfunctionssuchasanycodings_pythonglDrawArrays,etc.Youcandothisusinganycodings_pythonpyglet'sOpenGLbindings,orusinganycodings_pythonPyOpenGL's.Thegoodnewsisthatanycodings_pythonwhicheveryouuse,youcaninsertsuchanycodings_pythoncallsrightintothemiddleofyouranycodings_pythonexistingpygletapplication,andtheyanycodings_pythonwill'justwork'.Transitioningyouranycodings_pythoncodefromPyglettoPyOpenGLisfairlyanycodings_pythoneasy,sothisisnotadecisionyouneedanycodings_pythontoworryabouttoomuchupfront.Theanycodings_pythontrades-offbetweenthetwoare: PyOpenGL'sbindingsmaketheOpenGLanycodings_pythoninterfacemorefriendlyandpythonic.anycodings_pythonForexample,youcanpassvertexarraysanycodings_pythoninmanydifferentforms,ctypesarrays,anycodings_pythonnumpyarrays,plainlists,etc,andanycodings_pythonPyOpenGLwillconvertthemintoanycodings_pythonsomethingOpenGLcanuse.Thingslikeanycodings_pythonthismakePyOpenGLreallyeasyandanycodings_pythonconvenient. pyglet'sOpenGLbindingsareanycodings_pythonautomaticallygenerated,andarenotasanycodings_pythonfriendlytouseasPyOpenGL.Foranycodings_pythonexample,sometimesyouwillhavetoanycodings_pythonmanuallycreatectypesobjects,inorderanycodings_pythontopass'Cpointer'kindsofargstoanycodings_pythonOpenGL.Thiscanbefiddly.Theplusanycodings_pythonsidethough,ispyglet'sbindingstendsanycodings_pythontobesignificantlyfaster. Thisimpliesthatthereisanoptimalanycodings_pythonmiddleground:Usepygletforwindowing,anycodings_pythonmouseevents,sound,etc.Thenuseanycodings_pythonPyOpenGL'sfriendlyAPIwhenyouwanttoanycodings_pythonmakedirectOpenGLfunctioncalls.Thenanycodings_pythonwhenoptimising,replacejustthesmallanycodings_pythonpercentageofperformance-criticalanycodings_pythonPyOpenGLcallsthatliewithinyouranycodings_pythoninnerrenderloopwiththepygletanycodings_pythonequivalents.Forme,thisgivesmeanycodings_pythonbetween2and4timesfasterframerates,anycodings_pythonwithPyOpenGL'sconveniencefor90%ofanycodings_pythonmycode. 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink joy 5 Answers3:ofPyOpenGlorpyglet TryModernGL. pipinstallModernGL PyOpenGLisanauto-generatedversionofanycodings_pythontheoriginalOpenGLAPI(generatedwithanycodings_pythonSWIG).TheoriginalOpenGLAPIisnotanycodings_pythonpythonfriendly.Generatedpythonanycodings_pythonbindingsarehardtouse. pygletismostlyforthewindowcreationanycodings_pythonandeventhandlinghoweveryoucanyouaanycodings_pythonPyOpenGLlikeAPI(forexampleanycodings_pythonpyglet.gl.glClearColor) pygameprovidesawindowwhereyoucananycodings_pythonusePyOpenGLtodotherendering. ModernGLisagreatalternativetoanycodings_pythonPyOpenGL,YoucanusethemodernOpenGLanycodings_pythonAPIwithlesscodewritten.ModernGLanycodings_pythonwillnotcreateawindowbyitself,butanycodings_pythonyoucanintegrateitinpyglet,pygame,anycodings_pythonPyQt5andeveninGLUT.EditYoucanuseanycodings_pythonmoderngl-windowtocreatewindowsanycodings_pythonindependentlynow. pipinstallanycodings_pythonmoderngl-window InModernGLyoucancreateasimpleanycodings_pythonshaderprogramwithasinglecall: prog=ctx.program( vertex_shader=''' #version330 invec2in_vert; voidmain(){ gl_Position=vec4(in_vert,0.0,1.0); } ''', fragment_shader=''' #version330 outvec4f_color; voidmain(){ f_color=vec4(0.3,0.5,1.0,1.0); } ''', ) WithModernGLyouhavefullcontroloveranycodings_pythontheOpenGLAPI. 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink miraj 1 Answers4:ofPyOpenGlorpyglet I'dsaythatPygletisactuallymoreanycodings_pythonevolvedthanPyOpenGL.IthasaniceAPIanycodings_pythonofit'sown,andithasafullwrapperanycodings_pythonaroundOpenGLaccessedthroughtheanycodings_pythonpyglet.glmodule!PyOpenGLdoesn'tevenanycodings_pythonwrapallthefunctionsOpenGLanycodings_pythonhas. Pygletalsohasagreatlibraryforanycodings_pythonrendering2Dwithhardwareaccelerationanycodings_pythonthroughOpenGL,andit'sreallywellanycodings_pythonmade. Ifyouwantapowerfulreadymade3Danycodings_pythonengineyou'vegotOgreandsuch 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink miraj 2 Answers5:ofPyOpenGlorpyglet Hmm,iwouldsuggestpyglet,itreallyanycodings_pythonprovideseverythingneededbyagameoranycodings_pythonapplication. Mindyou,youcandoalotofthingsanycodings_pythonpygletdoeswithPyOpenGL,forexampleanycodings_pythontocreateawindowallyouneedtodoanycodings_pythonis: glutInitWindow(title) AlthoughithinkglutInitDisplayModehasanycodings_pythontobecalledbeforethat. Simplesummary:ifyoudon'twannacodeanycodings_pythonuntilyoucry,choosepyglet,butifyouanycodings_pythonwanttobeamaster,choosePyOpenGL.anycodings_pythonGotohttp://pyopengl.sourceforge.nettoanycodings_pythonreadthedocsonPyOpenGLandtoanycodings_pythonhttp://pyglet.orgtoreadthedocsonanycodings_pythonpyglet.Hopethiswashelpful! 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink miraj 6 Answers6:ofPyOpenGlorpyglet pyglethasalotofniceextrasincludedanycodings_pythonwithit(likeimageloadingandsound).anycodings_pythonIfyou'restartingout,I'dtrypygletanycodings_pythonfirst,andthenswitchtoPyOpenGLifanycodings_pythonyoufeellikeyouwanttogetclosertoanycodings_pythonthemetal. Therealimportantquestionthoughis:anycodings_pythonwhatareyoutryingtoaccomplish? 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink jidam 4 Answers7:ofPyOpenGlorpyglet Ipromotepygletbecauseithastheanycodings_pythonnicestAPII'veyetseenonstufflikeanycodings_pythonthis. PyglethasopenglAPIaswell.Butit'sanycodings_pythonoftennicertousetherecentlyaddedanycodings_pythonvertexlistsupport. pyglet.gl 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink joy 3 Answers8:ofPyOpenGlorpyglet pyglet'sGLAPIisnowherenearasniceanycodings_pythonasPyOpenGL's-pyglet'sisattherawanycodings_pythonctypeslayerwhichmeansyou'llneedtoanycodings_pythonlearnctypesaswell.Ifyou'replanninganycodings_pythonondoingabunchofOpenGLprogramminganycodings_pythonyou'llwanttousePyOpenGL. Thenicethingisyoucanmixthetwoanycodings_pythonjustfine.UsepyglettoprovidetheGLanycodings_pythoncontext,sounds,events,imageloadinganycodings_pythonandtexturemanagement,textrendering,anycodings_pythonetc,etc.UsePyOpenGLfortheactualanycodings_pythonOpenGLprogrammingyouneedtodo. 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink joy 5 Answers9:ofPyOpenGlorpyglet IwouldrecommendPygletbecauseitisanycodings_pythonveryeasytogetstartedandhaveanycodings_pythonsomethingbasicrunning,andthenyouanycodings_pythoncanaddmoreadvancedtechniquesatyouranycodings_pythonownpace. 0 2022-09-19T01:25:18+00:002022-09-19T01:25:18+00:00AnswerLink jidam Topratedtopics Ihave5htmlbuttonsand32images,and32combinationstodisplayimagesFacingjava.net.SocketException:SocketclosedinAndroidIwasnotdeclearinthiscscopecpp,butanotheriisworkingQ:ARRAYOFOBJECT Whytitledoesnotchangeintkinter?Cameraisnotworking?kotlin-QRcodescannerPhantomJS2.1.1returnserrorwhilerunningnpmtestDisablingpreemptionforonenode ReadfromtextfilelinebylineintosubstringwithSQLplusHowcanIputendIconinTreeViewMaterialUIinReactJS?UTMparameterforwardingincombinationwithabuttonExecutingdatefieldwithnullinplsqlDelphiLivebinding,errorconvertingtexttoTStringsfieldFlutter2.5MultipleerrorsinAndroidmanifest.xmlWIn32API-Subclassingawindow,myfirstattemptGroupingmultipleMysqlstatementstofetchcountofmultiplestatusesMultipleboxplotsinmatplotlibwithoutknowingthenumberofplots?HowcanIrunacommandwithvalues​inpythonsqlite3?RemovespecificlegendapachepoiexcelgraphXDDFChartLegendAreCloudEventsusefulongRPCframework?Howcanwefindthebalanceofcreditsinsnowflake?ExplodingakeynotpresentinJSONinPySparkTryingtoconnecttowebsockettomychatappbackendwhichishostedinherokuwithmylocalreactapp,postmancanconnectionbutnotmylocalcodeConvertingfunctionalcomponentintoclasscomponentreactjsHowdoIfinda10-digitnumberaccordingtothefirstthreenumbersinthetext?PythonTextoverflowinginfixeddivPython3.8:leadingzerosindecimalintegerliteralsarenotpermitted;usean0oprefixforoctalintegersOverwritingfunctionreturnaddressusingbufferoverflowWhytheerrorasyncio.exceptions.TimeoutErrorWhatarethebasicrulesandidiomsforoperatoroverloading?ModulenotfoundinDockercontainerDoineedtodeleteexistingPostgresqlschemabeforerestoringitfrombackup@PublishedarrayvaluenotupdatinginswiftUIViewHowtochangedefaultnamespaceinkubernetes'contextfromdefaultkopscommand?WhatexactlyisHANDLE,LPCVOIDandLPVOIDinwinapi?(specifictoReadProcessMemory)FlutterNullSafetyerrorwhilecreatingaTimer|FlutterGoogleHelveticafontnotgettingloadwithcss2API(403error)SinceVSCodeupdatev1.60BreakpointsnotboundWhydoIneedtocast'this'toaninterfacewithadefaultimplementationinC#8.0whenIcallitintheclassderivedformthatinterface?Usingcopyactivity,howtosnaplastdayfileofamonthfromdatalakegen2folderandstoreittoanotherfolderinthesamedatalakeusingADF?Howto"catch"console.error()?(SOtitle)LinkdirectivesinRstgrammarGettingerrorwhilereadingfileinbatchscriptBoto3dynamodbUnittesterrorusingmoto-Error"Anerroroccurred(ResourceNotFoundException)whencallingtheScanoperation"JQuerycreateanelementwithattributeswhichcontainhyphenUnexpectedtoken'-'UnderstandingunderlyingtypeofC/C++bitfieldsHowtoopenlinksinfooterwithselenium"ThisisnolongerlocatedinXXXX.Verifytheitem’slocationandtryagain"errorwhentryingtoaccessfileDisplayAlertsandRemoveitusingStatesHowcanifind'inteval'insql?Isthereawaytoupdatep12filestoredinpersonalcertificatesofWindowscertificatestorethroughCertUtilcommandline? Top ©2022 ANYCODINGS.COM-AllRightsReserved. AboutUs ContactUs DMCA PrivacyPolicy Disclaimer Terms&Conditions



請為這篇文章評分?