# Unexpected effect with X rotation matrix

This topic is 605 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

cos(RMS)=X/pixX^2+pixY^2(Pixel Manipulation)

cos(Wir)=Z/pixX^2+pixY^2(Pixel Manipulation)

Z/X=cos(Wir)/cos(RMS)

Zsin()+Xcos()
Zcos()-Xsin()
Y

Wi 3bit
R 8bit
Rotation Equation 11bit
Rotation matrix only X
X*(cos(RMS+Wi)+Z/Xsin(RMS+Wi))

Makes an image Wavy Moving closer to the image makes it appear to rotate.

CODE BELOW

for (var RMS = 0; RMS < 256; ++RMS) {
for (var Wir = 0; Wir < 8; ++Wir) {
rotoS[RMS*8+Wir]=-1+1/(Math.cos((RMS+8*Wir)/128.0*3.14)+(Math.cos(Wir/16.0*3.14)/Math.cos(RMS/128.0*3.14))
*Math.sin((RMS+8*Wir)/128.0*3.14))
}
}

data[i+((-Math.abs((i%512)-256)*rotoS[256])+0.5| 0)%512] = (a << 24) |
(b << 16) |
(g << 8) |
r;

Edited by Infinity8378

##### Share on other sites

cos(R)=X/pixX^2+pixY^2(Pixel Manipulation)

cos(Wi)=Z/pixX^2+pixY^2(Pixel Manipulation)

Z/X=cos(Wi)/cos(R)

Zsin()+Xcos()
Zcos()-Xsin()
Y

Wi 3bit
R 8bit
Rotation Equation 11bit
Rotation matrix only X
X*(cos(RMS+Wi)+Z/Xsin(RMS+Wi))

Makes an image Wavy Moving closer to the image makes it appear to rotate.

CODE BELOW

for (var RMS = 0; RMS < 256; ++RMS) {
for (var Wir = 0; Wir < 8; ++Wir) {
rotoS[RMS*8+Wir]=-1+1/(Math.cos((RMS+8*Wir)/128.0*3.14)+(Math.cos(Wir/16.0*3.14)/Math.cos(RMS/128.0*3.14))
*Math.sin((RMS+8*Wir)/128.0*3.14))
}
}

data[i+((-Math.abs((i%512)-256)*rotoS[256])+0.5| 0)%512] = (a << 24) |
(b << 16) |
(g << 8) |
r;

Doing this doesn't fix it by the way

rotoS[RMS*8+Wir]=(-1)+

(Math.cos((RMS+8*Wir)/128.0*3.14)+(Math.cos(Wir/16.0*3.14)/Math.cos(RMS/128.0*3.14))
*Math.sin((RMS+8*Wir)/128.0*3.14))
Edited by Infinity8378

##### Share on other sites

The problem Is basically i use the rotation matrix to get X and subtract the Old PixX and input the new X there isn't anything else

##### Share on other sites
Dear good people of <forum>,

I am trying to do <objective>, and I am not succeeding. I read <source> and I thought <method> would do what I want.

This is what I tried:
<code>

I was expecting to get <expected_result>, but I got <unexpected_result> instead.

I have tried to debug it using <tool> and I am confused about <puzzling_observation>.

Any help would be much appreciated.

Thank you,
<nice_forum_member>

##### Share on other sites

The following shrinks with the Rotation matrix with no artifacts but i prefer the rotation before more. It only scales and doesn't rotate. Since this is the Rotation equation why doesn't it rotate the X,Y,Z plane using Wi as the z divided by magnitude of vector pixX,PixY

rotoS[RMS*8+Wir]=(Math.cos((RMS+8*Wir)/128.0*3.14+Math.cos(RMS/128.0*3.14)/Math.cos(Wir/16.0*3.14)*Math.sin((RMS+8*Wir)/128.0*3.14)))

data[i-i%480+((Math.abs((i%480)-240)*rotoS[64+chig])+0.5| 0)] = (a << 24) |
(b << 16) |
(g << 8) |
r;
}
Edited by Infinity8378

##### Share on other sites

The following shrinks with the Rotation matrix with no artifacts but i prefer the rotation before more. It only scales and doesn't rotate. Since this is the Rotation equation why doesn't it rotate the X,Y,Z plane using Wi as the z divided by magnitude of vector pixX,PixY

rotoS[RMS*8+Wir]=(Math.cos((RMS+8*Wir)/128.0*3.14+Math.cos(RMS/128.0*3.14)/Math.cos(Wir/16.0*3.14)*Math.sin((RMS+8*Wir)/128.0*3.14)))

data[i-i%480+((Math.abs((i%480)-240)*rotoS[64+chig])+0.5| 0)] = (a << 24) |
(b << 16) |
(g << 8) |
r;
}

I figured it out I have to redo the Zbuffer with Wi if I do it this way which would make it larger than if I just Rerender the plain and I have to make sure I didn't Write the wrong equation for Wi. This takes up more RAM each frame With Zbuffer+NewPixX+newPixY Var each at 8 bit that its more efficient to just rerender the 16 bits.

Edited by Infinity8378

##### Share on other sites
[attachment=35661:DoesntGetItAtAll.jpg]

##### Share on other sites

Wi was fine when I checked.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633767
• Total Posts
3013737
×