Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
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  
  2 jogl questions  (Read 907 times)
0 Members and 1 Guest are viewing this topic.
Offline kendric

Junior Newbie





« Posted 2007-04-18 15:56:33 »

#1) I want to have fixed position fixed size text in 3d opengl. So basically i wanted to use the raster2i and the glutbitmap text. Is this possible, it seemed like the raster2i only worked in ortho mode and not in 3d mode(my text wouldn't appear on screen in 3d mode)
#2)I want a scrolling background. I had this working in my project in java2d before i ported to jogl, but I can't figure out how to draw a texture directly to screen co-ordinates rather then just mapping it to a quad. If i map it to a quad it doesn't get an absolute position and its very hard to get it to wrap around as the player goes in a straight direction. If i could just somehow paste the image verbatim and then do my 3d rendering that would work. Now that I type this I wonder if i can switch between ortho and 3d mid render...
If anyone has any thoughts I would apreciate it. Thanks.
Offline kendric

Junior Newbie





« Reply #1 - Posted 2007-04-18 17:43:59 »

I figured out why glRasterPos2f wasn't working, It wants 0,0 for the center of the screen, and it looked like -0.5,-0.5 was the bottom left. So i guess my question on this is now, is this arbitrary or is -.5 -.5 the exact bottom left corner such that a picture drawn that was screenwidth,screenheight and having the raster set to -.5 -.5 would fit perfectly on the screen no matter what size the screen was?
Offline kendric

Junior Newbie





« Reply #2 - Posted 2007-04-19 22:35:29 »

Figured out the scrolling background:

Thanks for the help. Incase anyone else wants a moving background, basically what I ended up doing was this:

x=gameXPos%textureWidth*scrollSpeed
y=gameYPos%textureHeight*scrollSpeed

x/=textureWidth*scrollSpeed
y/=textureHeight*scrollSpeed

map texture to quad as follows
0+x,0+y
1+x,0+y
1+x,1+y,
0+x,0+y

Thanks for your help!

Next I have to figure out how to solve the problem that a giant texture like this causes massive slow downs and memory consumption. I could use a smaller one and tile it, but i liked the idea of having distinct things in my background that shouldnt have 4-5 copies on the screen at once.

My current background is 2048x2048(idea being i could have 4 completly unique screens of background they can move through(they move in all cardinal directions))

For the text i believe I can switch to ortho view and then put it back after im done with the text.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (55 views)
2013-05-17 21:29:12

alaslipknot (65 views)
2013-05-16 21:24:48

gouessej (95 views)
2013-05-16 00:53:38

gouessej (92 views)
2013-05-16 00:17:58

theagentd (103 views)
2013-05-15 15:01:13

theagentd (94 views)
2013-05-15 15:00:54

StreetDoggy (140 views)
2013-05-14 15:56:26

kutucuk (162 views)
2013-05-12 17:10:36

kutucuk (161 views)
2013-05-12 15:36:09

UnluckyDevil (171 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.081 seconds with 21 queries.