Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Image scaling

 
Kevin Peterson
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I am creating a space style shooter and am currently tring to implement a star background(sort of like that Windows star screensaver where you feel like your moving forward). I pretty much have this finished and am now thinking about how images are going to enter the world. When you create an image that your are going to add to your scene in gimp for example would you draw it at its max in game size(in gimp) and then add it to some kind of imagebuffer in java and then scale it down and slowly scale it up as it moves close to you.

Thanks, Kevin
[ November 05, 2005: Message edited by: Kevin Peterson ]
 
Jared Cope
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Yes, I think that is a reasonable way to do it. Scale your image size up or down relative to some 'Z' axis value in your world.

The other way it is done in pure 3D is to create your model as a polygon which is only ever one size, and then have the 'camera' zoom in and out as appropriate. The scaling is automatically taken care of then. If you have the time and inclination, checkout the Java 3D library and give that a whirl.

Cheers, Jared.
 
Cosmo Haun
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Couldn't be sure from your post if you were looking for example code, but if you were, this codefetch search for game scale image buffer found this example 2D image scaling for games from the book Killer Game Programming in Java
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!