मैं अच्छा काम कर रहा है जब कैमरा घुमाया नहीं है मेरी लंबन पृष्ठभूमि ड्राइंगलंबन XY और रोटेशन - टाइल गणना
pGLState.pushModelViewGLMatrix();
final float cameraWidth = pCamera.getWidth();
final float cameraHeight = pCamera.getHeight();
final float shapeWidthScaled = this.mShape.getWidthScaled();
final float shapeHeightScaled = this.mShape.getHeightScaled();
//reposition
float baseOffsetX = (pParallaxValueX * this.mParallaxFactorX);
if (this.mRepeatX) {
baseOffsetX = baseOffsetX % shapeWidthScaled;
while(baseOffsetX > 0) {
baseOffsetX -= shapeWidthScaled;
}
}
float baseOffsetY = (pParallaxValueY * this.mParallaxFactorY);
if (this.mRepeatY) {
baseOffsetY = baseOffsetY % shapeHeightScaled;
while(baseOffsetY > 0) {
baseOffsetY -= shapeHeightScaled;
}
}
//draw
pGLState.translateModelViewGLMatrixf(baseOffsetX, baseOffsetY, 0);
float currentMaxX = baseOffsetX;
float currentMaxY = baseOffsetY;
do {
//rows
this.mShape.onDraw(pGLState, pCamera);
if (this.mRepeatY) {
currentMaxY = baseOffsetY;
//columns
do {
pGLState.translateModelViewGLMatrixf(0, shapeHeightScaled, 0);
currentMaxY += shapeHeightScaled;
this.mShape.onDraw(pGLState, pCamera);
} while(currentMaxY < cameraHeight);
//end columns
pGLState.translateModelViewGLMatrixf(0, -currentMaxY + baseOffsetY, 0);
}
pGLState.translateModelViewGLMatrixf(shapeWidthScaled, 0, 0);
currentMaxX += shapeWidthScaled;
} while (this.mRepeatX && currentMaxX < cameraWidth);
//end rows
pGLState.popModelViewGLMatrix();
सब कुछ के लिए इस कोड है।
जब यह घुमाया जाता है, मुझे लगता है कि टाइल (this.mShape
) चार बार (शीर्ष, नीचे, बाएं और दाएं) खींचा जाना चाहिए ताकि कोने में कोई खाली स्थान दिखाई न दे। उदाहरण के लिए, जब घूर्णन 45 डिग्री होता है, लेकिन मैं यह नहीं समझ सकता कि यह कैसे करें।
क्या आप ऐसी छवि डाल सकते हैं जो समस्या को समझाती है? मुझे लगता है कि मुझे पता है कि आपका क्या मतलब है, लेकिन मैं बस यह सुनिश्चित करना चाहता हूं। – Tim