Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 1097 times)
0 Members and 1 Guest are viewing this topic.
Offline kendric

Junior Newbie





« Posted 2007-04-18 13: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 15: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 20: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.

 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (30 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!