Results 1 to 5 of 5

Thread: C++ or Java for Non API Based 3D Graphics

  1. #1
    Join Date
    May 2008
    Posts
    97

    C++ or Java for Non API Based 3D Graphics

    hi there

    I am preparing a project in which i am creating a 3D engine for creation of a small game. I will have a large amount of objects that will be shaded and possible texture mapped. I am not using any API's, i will be programming all the matrix transformations and code to render and display the moving 3D scene.

    My question is that i understand that without API's taking advantage of hardware acceleration, the game could be very lagging in nature due to the computational expense of everything that needs to be calculated to draw each frame during creation of this game engine. Is it possible to run game smoothly with no use of API's and if so, is it possible in Java, or i have to use C or C++, and does it matter as long as i have optomised my code well?

    Please provide some suggestion regarding this

    your views will be appreciated

  2. #2
    Join Date
    May 2008
    Posts
    2,012

    Re: C++ or Java for Non API Based 3D Graphics

    As you have noticed, most of us recommend you to not write a basic library, by the way already available around. This is time consumming and error pronning.

    About OpenGL weakness, take in mind that all major GPU's providers (ATI, nvidia) and ISH which uses such GPU's make their cards compliant to both Directx and OpenGL.

    Also I don't recommend you to GPU programming, because you lost portability to others GPU's than those you have programed to. Except if you are in researching top performance at any cost, which is a good reason to do that. Many researchers are using the GPU as a coprocessor for heavy math programmimg (mainly in matrix operations).

    I like too very much gamedev stuff, in particular NeHe, which was better when independent from gamedev, but still good.

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: C++ or Java for Non API Based 3D Graphics

    Java is actually a general-purpose programming language, so when looking at it in
    terms of graphics, it exists at the same level as C and C++, not OpenGL.
    Like C and C++, Java is host to a number of graphics-related APIs. Unlike C and C++,
    these Java APIs are more uniform and standardized than their equivalents in C, C++,
    and other languages.
    Choose your weapon:
    – AWT — user interface framework that is a thin wrapper to the host operating system’s user
    interface facilities; generally not used these days
    – Swing — the portable (and official) Java user interface framework; features pluggable lookand-
    feels and more types of components
    – Java2D — Java’s 2D graphics API; co-exists with AWT and Swing, both “below” and
    “above” them
    – Java Advanced Imaging (JAI) — Java’s image processing plug-in API; builds imagespecific
    functions on top of whatever is already in Java2D
    – Java3D — Java’s 3D graphics API, using a scene-based approach; recently went open source
    Other graphics-related Java APIs exist, both from Sun and not, such as:
    – Java Image I/O, Java Media Framework: additional Sun libraries
    – SWT, an alternative to the “official” AWT and Swing as a user interface framework; the
    Eclipse IDE is a very conspicuous user of SWT
    – jogl and GL4Java: more direct OpenGL wrappers for Java
    – and many more, including layers on top of Swing such as Buoy

  4. #4
    Join Date
    May 2008
    Posts
    2,297

    Re: C++ or Java for Non API Based 3D Graphics

    The Java 3D API allows you to develop 3D graphics applications that have a high degree of visual realism.

    Since version 1.2, Java 3D is developed under the Java Community Process. Java 3D runs on top of OpenGL or Direct3D; it's also an interface that encapsulates graphics programming using a real, object-oriented concept. In addition, Java 3D offers extensive 3D sound support.

    This article describes a scene that is constructed using a scene graph, which is a representation of the objects that have to be shown. This scene graph is structured as a tree containing several elements that are necessary to display the objects.

    3D world mechanisms

    The design of Java 3D is significantly different from popular 3D graphics APIs such as OpenGL and Direct3D, which are low-level procedural APIs that are closely tied to the design of 3D hardware. With Java 3D, you set up all your graphics objects (also called geometry objects) in a scene graph, which is a hierarchical model containing all the information about the objects in your scene and how they will be rendered. Then, you hand the scene graph over to Java 3D for rendering. You don't have to write any code to handle displaying your data -- Java 3D does it for you. You get to program at a higher level with the many built-in power tools.

    Java 3D can take advantage of any 3D acceleration that your graphics adapter provides. Java 3D ultimately generates OpenGL calls in a JNI layer that can be accelerated by your graphics card. OpenGL accelerated adapters are common in newer workstations, so your Java 3D programs should be hardware accelerated.

    In a three-dimensional coordinate (x,y,z), the z component specifies distance from the viewer. Java 3D uses z values to remove nonvisible surfaces of distance obscured objects. The z values of the red torus in the image below are small because it is close to the viewer. It will obscure portions of the blue torus when the z values of both tori are compared during rendering

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: C++ or Java for Non API Based 3D Graphics

    If you need to manage graphics, images (such as JPEG, PNG, GIF images) or pictures of any kind, or handle animation in your programs, including writing games, drawing 3D or 2D pictures, you might like to consider the graphics libraries, 3D engines, 2D engines, image manipulation source code (etc) listed here. Some of these are actually production code, used in commercial products.

    If you are looking for game programming libraries and source code, you should also check out our Free Game Programming Libraries and Source Code page. The decision to list a particular library or source code package on one or the other page is sometimes arbitrary, so you really should check both pages whether you want graphics libraries or games programming libraries. In addition, if you are looking for a graphical user interface for (GUI) for your program, try the Free GUI Libraries and Source Code page as well. Possibly also relevent is the Free 3D Content Creation Software, Free Image Editing and Drawing Tools page, where you can find software to draw your game objects, backgrounds, textures and create animations, etc.

    If you are looking for more information on game programming, you might want to check out the list the books on Game Programming on Amazon.com.

Similar Threads

  1. Online Java-Based x86 Emulator
    By Dude111 in forum Technology & Internet
    Replies: 2
    Last Post: 31-07-2012, 01:19 AM
  2. How To Play Java Based Mobile Games On Computer
    By OSzilla in forum Video Games
    Replies: 5
    Last Post: 16-01-2010, 04:26 AM
  3. urgent: java based application using dataset
    By pinns in forum Software Development
    Replies: 2
    Last Post: 20-01-2009, 09:41 AM
  4. Windows 7 Brings Software Based Graphics
    By stripe in forum Operating Systems
    Replies: 1
    Last Post: 11-12-2008, 01:07 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,462,404.78829 seconds with 17 queries