Sign in to follow this  
Infinity8378

Unexpected effect with X rotation matrix

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this