Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (108)
games submitted by our members
Games in WIP (536)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  3D Circles  (Read 1185 times)
0 Members and 1 Guest are viewing this topic.
Offline Malohkan

Senior Member




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


« Posted 2005-07-15 23: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

Junior Member




Java (games) rock!


« Reply #1 - Posted 2005-07-15 23:57:35 »

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

Senior Member




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


« Reply #2 - Posted 2005-07-16 01: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! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Malohkan

Senior Member




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


« Reply #3 - Posted 2005-07-19 18: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]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CogWheelz (16 views)
2014-07-30 21:08:39

Riven (23 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!