我已经习惯了现代的OpenGL语法,但是我必须处理一个使用旧语法的现有代码,尽管它应该更简单,但这对我来说太困惑了!
我想知道使用glMulMatrix
(并传递翻译矩阵)和使用glTranslate
并传递x
,y
和z
之间的区别翻译?
同样的问题适用于glMulMatrix
(并传递轮换矩阵)或使用glRotate
并传递x
,y
和z
轮换?
答案 0 :(得分:2)
使用[
{
"TestId":1,
"AccountId":1,
"SomeString":"This is an updated test",
"SomeTimestamp":"2016-01-01T00:00:00Z",
"SomeDecimal":5.55
},
{
"TestId":3,
"AccountId":1,
"SomeString":"This is a third test",
"SomeTimestamp":"2016-01-01T00:00:00Z",
"SomeDecimal":5.55
},
{ ... removed for brevity ... }
]
,您需要自己创建矩阵(按列主要顺序),并使用该函数将其传递给OpenGL。通过使用[
{
"RowError":"",
"RowState":2,
"Table":[
{
"TestId":1,
"AccountId":1,
"SomeString":"This is an updated test",
"SomeTimestamp":"2016-01-01T00:00:00Z",
"SomeDecimal":5.55
},
{
"TestId":3,
"AccountId":1,
"SomeString":"This is a second test",
"SomeTimestamp":"2016-01-01T00:00:00Z",
"SomeDecimal":5.55
},
{ ... removed for brevity ... }
],
"ItemArray":[
1,
1,
"This is an updated test",
"2016-01-01T00:00:00Z",
5.55
],
"HasErrors":false
},
{
"RowError":"",
"RowState":2,
"Table":[
... there seems to be an instance of this for every row in the result ...
],
"ItemArray":[
1,
1,
"This is an updated test",
"2016-01-01T00:00:00Z",
5.55
],
"HasErrors":false
}
]
或glMultMatrix
,您只需传递参数并让OpenGL构建它。
之后,处理将是相同的。在过去,对于初学者来说,使用glTranslate
或glRotate
更容易理解和使用,而对于更高级的用户,glTranslate
更自然,因为通常您会积累转换(场景图)并将其传递给复合场景。