Jump to content
  • Advertisement
Sign in to follow this  
xavstone

Models warping with rotation

This topic is 1237 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

Hi,

 

I have built a rudimentary 3d engine. All was going well until I implemented a clip frame. Now when I rotate objects im getting some strange warping effects.

 

I thought I would post some videos to see if anyone had any idea what was happening before posting code.

 

The model in the video is a torus (believe it or not). Camera set in the middle of it. The torus should rotate around the camera. Half of it off scene - Im  clipping triangles if any vertex has a point outside the clipping area.

 

Here are the clips:

Rotating around bank (z) preserves the geometry for a little while:

 

Similarly to pitch (x):

 

Rotating around all Euler Angles:

 

I'm hoping someone has encountered similar and can point me in the right direction.

 

Many thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
I wrote a wire frame renderer in assembly language for a comp Sci course in 1995 that behaved a lot like that. My rotation code was all fouled up, though I no longer remember the exact nature of the foulness. You will probably have to post some code to get an answer.

Share this post


Link to post
Share on other sites

1) Check you didn't typo the name of any axis.

 

2) If you aren't using a matrix for the rotation, make sure that you're using the old coordinates when computing the new position. Something I tend to forget is that modifying the first axis will change the value used for the computation in the other axis. Moving the old coordinates to a temporary variable and then using that for the computations solves the issue.

 

But yeah, just throwing away some ideas, no idea what's going on in your code to tell for sure. I'd strongly suggest to check for #1 though, since I have a feeling that it may be something like that.

Share this post


Link to post
Share on other sites

Thank you both for responses.

 

Turns out you were right Sik. I was calculating new position of each axis and using the value in the next. Using a temporary variable as you suggested fixed the problem (if slowing the frame rate somewhat).

 

I still have some perspective issues which I suspect are related to my clip matrix. I will post these further problems in a different thread.

 

Many thanks once again :-)

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!