Java-Gaming.org
Java4K - to go Javadoc:
rt.jar
slick.jar
lwjgl.jar
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members
News
: Read the
Java Gaming Resources
, peek at
the official java tutorials
or join us at irc:
#jgo
.
Home
Help
Search
Login
Register
Java-Gaming.org
>
Java Game APIs & Engines
>
OpenGL Development
>
JOGL Development
>
2 jogl questions
Pages: [
1
]
Print
2 jogl questions
(Read 762 times)
0 Members and 1 Guest are viewing this topic.
kendric
JGO n00b
Posts: 4
2 jogl questions
«
on:
2007-04-18 09: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.
kendric
JGO n00b
Posts: 4
Re: 2 jogl questions
«
Reply #1 on:
2007-04-18 11: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?
kendric
JGO n00b
Posts: 4
Re: 2 jogl questions
«
Reply #2 on:
2007-04-19 16: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
]
Print
Jump to:
Please select a destination:
-----------------------------
Discussions
-----------------------------
=> General Discussions
===> Suggestions
=> Business and Project Discussions
===> Jobs and Resumes
===> Community & Volunteer Projects
=> Miscellaneous Topics
-----------------------------
Game Development
-----------------------------
=> Newbie & Debugging Questions
===> Java Game Tutorials
=> Game Play & Game Design
=> Game Mechanics
===> Artificial Intelligence
=> Networking & Multiplayer
=> Performance Tuning
=> Shared Code
-----------------------------
Games Center
-----------------------------
=> Featured Games
=> Showcase
=> Contests
===> LWJGL16k - 2011
===> 4K Game Competition - 2012
===> JGO Comp Petite
===> Finished Contests
=====> 4K Game Competition - 2011
=====> 4K Game Competition - 2010
=====> 4K Game Competition - 2009
=====> 4K Game Competition - 2008
=====> 4K Game Competition - 2007
=====> 4K Game Competition - 2006
=====> 4K Game Competition - 2005
=====> Tiny Game 2010
=====> JGO Comp 2009
=====> 16K LWJGL Competition - 2005
=====> Java Technology Game Development Contest - 2004
-----------------------------
Java Game APIs & Engines
-----------------------------
=> Engines, Libraries and Tools
===> Java 3D
===> JInput
===> jMonkeyEngine
===> Xith3D Forums
===> Tools Discussion
=> Java 2D
===> JavaFX
=> OpenGL Development
===> JOGL Development
===> LWJGL Development
=> Java Sound & OpenAL
===> JOAL Development
=> Java on Mobile Devices
===> Android
===> J2ME
-----------------------------
Resources
-----------------------------
=> Articles & tutorials
Loading...