Jump to content
  • Advertisement
Sign in to follow this  
Infinity8378

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.

If you intended to correct an error in the post then please contact us.

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
Advertisement

 

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!