Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  3D Circles  (Read 887 times)
0 Members and 2 Guests are viewing this topic.
Offline Malohkan

JGO Neuromancer
****

Posts: 1108
Medals: 1


while (true) System.out.println("WOO!!!!");


« on: 2005-07-15 17:47:00 »

I want to be able to draw a circle under any transformation and have it still face the screen.  I can translate the circles anywhere, and rotate the camera, and make the circles face the camera.  My challenge now is that sometimes I rotate the circles about an arbitrary point, which as a result moves the circle from its original location.  Now I don't know what direction the circle is facing.  Is there a way to do a "glLoadRotationIdentity()" or something of the sort so that the current global translation is still in the same place, but the orientation is still in the "identity" direction?  Or is there a better way to figure out what direction I'm facing?

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline turquoise3232

Sr. Member
**

Posts: 332


Java (games) rock!


« Reply #1 on: 2005-07-15 17:57:35 »

Hi, the fast and easy way to answer I guess : google for "billboards"...
Offline Malohkan

JGO Neuromancer
****

Posts: 1108
Medals: 1


while (true) System.out.println("WOO!!!!");


« Reply #2 on: 2005-07-15 19:48:00 »

Well after 2 hours of searching and applying, I haven't gotten it yet.  I found this:

http://www.opengl.org/resources/tutorials/advanced/advanced97/programs/billboard.c

and that seemed like it was doing what I want.  It takes the modelview matrix and thus all of the transformations I've done into account.  However, after implementing it my circles are still never facing the scene and I can't make out any pattern to recognize what it's doing wrong.  It's simply all over the place.

I also searched the forums and found some code Tom wrote here:
http://192.18.37.44/forums/index.php?topic=3029.0
I tried that, but it didn't take into account the fact that I'm doing multiple transformations AFTER the camera transform.  His code did exactly what mine was doing before, making the circles face the screen assuming the gl(u)LookAt was the only transformation.

Any other ideas for me?  Maybe some other examples that take into account any arbitrary number of transformations after the camera?

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Games published by our own members! Go get 'em!
Offline Malohkan

JGO Neuromancer
****

Posts: 1108
Medals: 1


while (true) System.out.println("WOO!!!!");


« Reply #3 on: 2005-07-19 12:02:41 »

can I do something like... take the modelview matrix and set 3 of its entries to 0 to get rid of all rotation or something?  Hmm or will that not work?

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.089 seconds with 20 queries.