Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Image scaling

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic