• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Backgrounds

If you're already familiar with the Background node in VRML...then forget everything you know! Java 3D has a much simpler (and unfortunately, less flexible) background capability than VRML. As you may recall from Chapter 9, "Customizing Light, Background, Fog, and Sound," VRML can surround the user with six different texture-mapped images and a sky/ground background beyond that. In contrast, Java 3D offers a Background class that gives you only a choice of a solid color or a single, static background image (see Tables 15.3, Table 15.4, Table 15.5). The background image does not move as you change your point of view-it's like a backdrop that gets drawn first, before the scene is rendered in front of it.

This can be fairly limiting, but for many applications it works just fine. If you need something more sophisticated, you can always implement it yourself by creating a texture-mapped sphere around your world. This sphere (or box, or any other shape) can be made part of the "background geometry" of the scene, so that it's always rendered first before anything else. In order to illustrate how backgrounds work, we're going to use our VView application from a previous chapter (see Chapter 13, "Customizing Size, Location, and Orientation" ). We'll start by creating a bounding region, which will be a slightly scaled-up version of the bounding sphere we computed in order to position our viewpoint (see Listing 15.1).


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint