Jump to content
  • Advertisement
Sign in to follow this  
mathon

Rotate a square and bring it to the front

This topic is 4323 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 would like to draw a square which is displayed angular before and will be then brought to the front so you see it frontal. (for example by using a Slider). I want to use Java. i have here a little drawing where i tried do draw what i want to do bringingToFront does anybody know how i can realize this in a convenient way? lg matti

Share this post


Link to post
Share on other sites
Advertisement
I have done this in the past with OpenGL when I designed a menu system. I see a few ways to do this, but none of them are easy:

1) Fake it. You don't need true 3D since the projection will be the exact same every time. It would require some math. Basically you'll have to take the final image you want to draw in the flat square and project this onto the turned square. A perspective correct projection should get the job done.

2) Java3D or a library that supports OpenGL in Java (JOGL or something, I forget the name.) This would be the easiest way I think and that's how I did it under win32. I would just project my menu items onto a quad and rotate however I wanted. My menus would start turned away from the screen and then rotate in when I needed them. I didn't like the effect in the end though.

3) Write your own software renderer or find a free one and then do the same as in 2. Try www.javagaming.org.

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!