3D Rotation of images and depth testing a problem
in
Programming Questions
•
2 years ago
I have an image that I am trying to add an animation to by rotating part of it, and thus make it look like it is spinning:
The original image:
My main issue is what I suspect to be a depth testing problem:
Right now the code is using the opengl renderer, I can't use the P3D renderer because it just rotates the 'wings' (the part that is actually rotating) above the primary image instead of appearing above and below.
I have attempted to render it to an image and show that, but again, that fails - it just puts a huge dark square on the screen.
The code is for rendering presently is: (enemy.pde)
void
draw
()
{
pushMatrix
();
translate
(
_x
,
_y
);
scale(1/158.0);
image
(
body_back
,
-
22
,
-
22
);
image
(
body_front
,
-
27
,
31
);
image
(
body_mid
,
-
16
,
22
);
rotateY
(
satTheta
);
image
(
wing_left
,
-
80
,
-
39
);
image
(
wing_right
,
22
,
-
39
);
popMatrix();
}
The main code body is at:
https://github.com/iaefai/Spider_Penguin/ and it should run just out of the box, like all good processing sketches :P. It does have some music that is about 5mb in the data dir.
I also accept some wisdom on design.
1
