OpenGL: What does glRotatef rotate? - Stack Overflow

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

glRotatef, like glMultMatrixf, is used to modify the currently selected transformation matrix. This has an effect on how things are drawn ... Lessthan10daystoRSVP!Virtuallyjoinusatourinauguralconference,everyoneiswelcome. Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. LearnmoreaboutCollectives Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. LearnmoreaboutTeams OpenGL:WhatdoesglRotatefrotate? AskQuestion Asked 8years,1monthago Modified 8years,1monthago Viewed 13ktimes 8 3 WhenIcalltheglRotateflikethis: glRotatef(angle,0.0,1.0,0.0)//rotateabouty-axis Iknowitistorotatebyangledegreesabouttheyaxis. But,whatisbeingrotatedhere?Whichobjectexactly? Probablyasillyquestion,butI'mentirelynewtothis. Iwasabletorotatealineaboutit'sendpointusingtheanswerhere,butIdon'treallyunderstandhowitworksinternally. c++openglopengl-1.x Share Follow editedMay23,2017at12:10 CommunityBot 111silverbadge askedAug13,2014at18:19 sanjeevmksanjeevmk 4,23844goldbadges4040silverbadges6666bronzebadges Addacomment  |  2Answers 2 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 8 Nothingisbeingrotated,becauseOpenGLdoesnot"store"objects. glRotatef,likeglMultMatrixf,isusedtomodifythecurrentlyselectedtransformationmatrix.Thishasaneffectonhowthingsaredrawnsubsequently.Onesetsthematrices(andotherstuff!)howonewants,andthenonedrawsone'sobjects. Formoreinformation,seetheOpenGLredbook,andgooglearoundforthedifferencebetween"retainedmode"and"immediatemode". Share Follow answeredAug13,2014at18:24 SneftelSneftel 38.7k1111goldbadges6969silverbadges103103bronzebadges 2 1 NotonlydoesOpenGLnotstoreobjects,itliterallyhasnonotionoftheconceptofobjects. – TomKnapen Aug13,2014at18:27 @sanjeevmkThetransformationmatrixisappliedtotheverticesyoupassinusingglVertex. – TomKnapen Aug13,2014at18:31 Addacomment  |  2 glRotatewillactonthecurrentmatrix,whichisbydefaultGL_MODELVIEW.Doingsowillaffectany3Dobjectthatyoudrawinthesequence.ThecurrentmatrixischangedwithglMatrixMode. Themodel-viewmatrixisthenappliedtoanygeometryrenderedwithglVertex,glDrawArrays,etc. OpenGL-sidematricesarenowdeprecated.IfyouusecoreOpenGL3+,thesefunctionsarenolongeravailable.IfyouarenewtoOpenGL,Isuggestthatyouskiplearningtheoldwaysandfocusonmodern,shader-orientedOpenGL.Youcancheckthefollowinglinksforsomegoodtutorials. open.gl opengl-tutorial.org ogldev Share Follow answeredAug13,2014at18:29 glampertglampert 4,27122goldbadges2222silverbadges4848bronzebadges Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggedc++openglopengl-1.xoraskyourownquestion. TheOverflowBlog IspenttwoyearstryingtodowhatBackstagedoesforfree Aserialentrepreneurfinallyembracesopensource(Ep.486) FeaturedonMeta PlannedmaintenancescheduledforWednesday,21September,00:30-03:00UTC... RecentColorContrastChangesandAccessibilityUpdates Revieweroverboard!Orarequesttoimprovetheonboardingguidancefornew... ShouldIexplainotherpeople'scode-onlyanswers? Linked 0 OpenGl:Rotatelineaboutendpoint Related 2904 Whatisthedifferencebetween#includeand#include"filename"? 3760 Whatarethedifferencesbetweenapointervariableandareferencevariable? 3481 Whatdoestheexplicitkeywordmean? 2006 Whatistheeffectofextern"C"inC++? 2000 Whatismovesemantics? 2282 Whatisthecopy-and-swapidiom? 2429 WhatisTheRuleofThree? 2384 Whatarethebasicrulesandidiomsforoperatoroverloading? 2133 C++11introducedastandardizedmemorymodel.Whatdoesitmean?AndhowisitgoingtoaffectC++programming? 1588 Replacinga32-bitloopcounterwith64-bitintroducescrazyperformancedeviationswith_mm_popcnt_u64onIntelCPUs HotNetworkQuestions Isitacrimeto"steal"yourownmoneyfromabank? CanmyUKcompanyordermetojoinasocialevent? Sci-fihorrorshortstoryaboutalienthatwantstobeeaten Ifhumanswerethesizeofantscouldwehavecampfires? Wordsforrelativeorientationofsidesofdouble-sidedpaper? Howisthattherearetwodifferentwords,comparo,thatappeartobeidentical? WhywasJWSTcancelledin2011? Whatexactlyismeantbyisotropicandanisotropicwithwordvectors HowdoIdetectwhenanobjectisatacertaincoordinateusingpython? Isthereanalgorithmforthegenusofaknot? Closed-formexpressionforexcitationenergies,giventheexactXCfunctional UnclarityaboutPreorderclassinLean4 IsEPSGdefinedseparatelyforeachgeometrycolumn? ClarificationrewhosendsDMARCreports Howtochangerowwidth? LTspicecapacitorbug? HasNASAreleasedanyJWSTimagesofTrappist-1?Ifnot,why? DoesNECrequirejunctionboxestobeaccessiblewithouttools? Roadsiderepair:howtouseascrew-onPrestapumponatubewitharemovablevalvecore Numbersvs.Strings:Languagefitnesschallenge WhichrunwayshouldIuseandhowcanIrecogniseitinfurtherflights? Howtoproperlyacknowledgeanoldfamousmathematicianinmyarticle? Dobasiclandcardsenterthebattlefieldtapped? addatwo-linetextinsideacomponentincircuitikz morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. lang-cpp Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?