gpt4 book ai didi

java - JOGL - 翻译 GL_QUADS

转载 作者:行者123 更新时间:2023-11-29 05:48:17 24 4
gpt4 key购买 nike

在 JOGL 中,我尝试使用 GL_QUADS(即整个对象的不同组件)创建一些 3D 形状,到目前为止,这样做很好,但我不知道如何平移形状,必须有一种方法可以这样做但我对 GL_QUADS 不是很熟悉所以我不完全确定如何去做。编辑 gl.glVertex3f 只会导致形状大小不同,这似乎是我唯一可以编辑的东西,是否可以给 GL_QUAD 一个变量名?

最佳答案

您可以使用glTranslatef 函数:

// render the shape
gl.glTranslatef(5.0f, 0.0f, 0.0f); // translate along x, y, z
// render the shape - you will now have two shapes next to each other

关于java - JOGL - 翻译 GL_QUADS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14983551/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com