OpenGL: What does glRotatef rotate? - Stack Overflow
文章推薦指數: 80 %
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#include
延伸文章資訊
- 1OpenGL中平移函数glTranslatef()、旋转函数glRotatef()的理解
void glRotatef(GLfloat angle,GLfloat x,GLfloat y,GLfloat z);. 先解释一下旋转方向,做(0,0,0)到(x,y,z)的向量,用右手握住...
- 2OpenGL的glRotatef旋转变换函数详解 - 博客园
OpenGL的glRotatef旋转变换函数详解先看一下函数定义:void glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) ang.
- 3glrotatef(3) - Linux man page - Die.net
- 4Python GL.glRotatef函數代碼示例- 純淨天空
本文整理匯總了Python中OpenGL.GL.glRotatef函數的典型用法代碼示例。如果您正苦於以下問題:Python glRotatef函數的具體用法?Python glRotatef怎麽用?
- 5计算机图形学OpenGL中的glLoadIdentity、glTranslatef
glRotatef :将R(x,y,z,s)右乘与堆栈的栈顶变换矩阵。 glLoadIdentity:将堆栈的栈顶变换矩阵设置成单位矩阵。 glPushMatrix:将堆栈的栈顶变换矩阵复制一份...