Создание 3d Ring в Android/Openegl с индексным буфером Объекты
Прямо сейчас я создаю 3D-игру для Android/OpenGL, смысл в том, чтобы пролететь через такие 3D-кольца, сделанные с индексными объектами буфера, как показано на рисунках.
Моя проблема: На самом деле моя витая петля генерирует координаты, как и должна, но если я перевожу, она сжимается, потому что в этом случае координата Y не соответствует координате z.
Несколько дней я пытался найти способ компенсировать эту проблему, но безуспешно, любой из вас мог бы мне сказать, как создать переводимое 3D-кольцо в OpenGL/android с моими основами или даже без них, что очень помогло бы мне.
for (int y = 0; y < 32; y++) {
for (int x = 0; x < 32; x++) {
final float xPosR = 0.5f * (float) Math.cos((x) * move) ; //move = 2*Pi/31 : In this part the x coordinates are getting builded (after rotating they are actually the z coordinates)
final float yPosR = translationY + (float) Math.sin((y) * move) //translation = 1[enter image description here][1]/0 otherwise you could do it as translation with the modelmatrix
+ 0.5f * (float) Math.cos((x) * move) * (float) Math.cos((y) * move) ; //In this part the Y Coordinates are getting builded
final float zPosR = - (1f * (float) Math.cos((y) * move)) +
0.5f * (float) Math.cos((x) * move) * (float) Math.sin((y) * move); //In this part the z Coordinates are getting builded(after rotating they are actually the z coordinates)
//in the onDrawFrame Method it gets rotate 90 degree around the y-axis and translated -5 in the z-axis
heightMapVertexDataR[offsetR++] = xPosR;
heightMapVertexDataR[offsetR++] = yPosR;
heightMapVertexDataR[offsetR++] = zPosR;
Перевод = 1
Перевод = 0