Java3D vs OpenGL bindings
Hello. I would like to know what API is better for programming of a game engine: OpenGL or Java3D. Can anyone tell me what are the advantages of using each of these APIs? I've been using Java3D quite a while, but I've heard that it offers very limited features and that it's soon going to "die". I would like to know your oppinion: should I use some OpenGL Java binding (and more importantly, what binding) or should I keep using Java3D?
My experience with Java3D and JOGL ( a OpenGL binding for Java ) is fairly limited, so I guess my opinion doesn't really count, but still...
I think that if You are serious about writing a high performance graphics engine, then You have to go "as low as You can" - in Java this means "use bindings". Libraries like Java3D are useful, when you need to implement basic 3D graphics in a project that does not need any fancy graphics ( like shadows, bump-mapping, vertex and pixel shaders etc ). The strong point of Java3D is that once you've grasped the concept behind it, you can use it for various tasks - from showing a single 3d model of a car to creating a virtual city - and the workload of these tasks will be comparable. The problem is that you are limited by the possibilities and performance of Java3D and, moreover, your whole project has to be build around Java3D, which maybe annoying. On the other hand, when you decide to use an OpenGL binding, like JOGL for example, then you practically decide to take controll and responsibiity over everything that is going to be drawn. Now, the amount of possibilities is limited mainly by your skills in programming and sometimes by the hardware.
In general, one could say that Java3D is meant for getting average results in very short time, while bindings are meant for obtaining excelent results, but at a high cost in terms of time and effort.
Similar Messages
-
Java2d, Java3d or Opengl best performance
I am planning to write a game in java that must be multi-platform and must have a very good performance. I am making a kind of rts. This rts will only be 2d. I am planning to get as many moving little objects(pics) within a second as i can. What is the best method in doing so. Performance wise and implementing wise. I never worked with Java2d or Java3d and Opengl only with c++. So what is the best choice you reckon?
Also every performance/programming tip is welcom :-)I would definitly go with java2D. Its really easy to use and get started with. OpenGL in c++ is the best way to go for profesional games, but java can be fast engough for most simple stuff.
-
Hallo,
I'm planing to develop an application both for the desktop and the Android platform. Are there any plans to port java3d to OpenGL ES to use it on an Android phone?
Are there any other high level APIs for the Android platform?There may be any number of subtle issues but this problem came down to one line in the source code that is produced when you choose OpenGL ES based iPhone OS project in XCode:
#define USEDEPTHBUFFER 0
Yes, it should have been obvious but I had a megabyte of source code I was trying to port, yada, yada.... Change the 0 to 1 and change:
glClear(GLCOLOR_BUFFERBIT);
to
glClear(GLCOLOR_BUFFERBIT| GLDEPTH_BUFFERBIT);
Now all the platonic solids are drawing and rotating just fine. -
Hello,
I have developped an application using java3D but I don't know if my application use OpenGL or not. Despite the fact that i have try to launch my application on an other computer which had not OpenGl, I haven't see a difference.
So my questions are :
How a developper know if his program use properties of OpenGL ?
Is there a class that instantiate OpenGl and which has methods that could accelerate my application ?
Thanks.OpenGL may or may not be used behind the scenes for better performance. Or maybe directX will be if thats what the user has chosen to install on their machine. Theres no way to find out via code whats being used - acceleration is already being used so you dont have to worry about it.
-
With talk of j3d in a "holding pattern" and the new OpenGL bindings being introduced ( http://games.dev.java.net/ ) is it worth keeping working with Java3D for the project I'm about to start on or should I go the extra mile and just start learning OpenGL? Or just wait to see if they integrate the two a little more closely?
Sometimes I wonder why J3D did not become an instant success. Look at it, it's hardware accelerated 3D mumbo-jumbo in your web browser (or application, but that's nothing new).
In the recent past you could sell almost everything, just because it could be run in a web browser.
The answer is a sad one. Everytime I made a nice Applet for the world to look at, the response was similar:
- "Your thingie does not run." (standard user without JRE)
- "What!? I have to download something, that is several MB in size to view a spinning torus?" (standard user)
- "And it's not even a self-installing browser plugin?" (same as above, using IE)
- "CLASSPATH?" (well...)
- "... if you access the stencil buffer now..." (friend of mine, doing OpenGL in C++)
The main problem is, as usual with Java, distribution. If J3D would be part of the standard JRE, not an optional package, things would look much better.
I hope the automatic download mechanism, introduced in 1.4.2, will make distribution a task for the developer, not the user.
Thousands of web masters would be interested in the use of 3D technology, but not at the price of scaring 99% of the users away at the front page.
But switching from J3D to OpenGL... the learning curve is steep, very steep.
Regards
Fleischer -
ImageIO, Timers, Transparency and a Rant
Hi all,
<BEGIN RANT>
After years of writing games and programming next-gen consoles, I foolishly decided to write a few online java games. Like many, I chose Java because it is very similar to c++ and accessible cross-platform on web pages by the masses with no extra downloads required (btw, I'm not using j3d for this reason). Instead I've found it to be nothing but a burden.
Today's gripes are below. If I sound like I'm having a rant, well, adter fighting it all this week, I am!. Any help/suggestions/discussions are most appreciated. I'm currently using j2sdk 1.4.1_02.
1) why can't I enable hardware accleration (currently transparency sucks on the framerate) without requiring permissions? What exactly am I going to do with it to make it a security risk?
2) Why doesn't Java (without j3d or any other extensions) support the high-resolution timer? Such a basic issue that has been plaguing these forums for years. It seems i can't even do a work around as using JNI requires permissions and an external module on the users machine so I can't do this from an APPLET without signing and installing something. Sure, I could just about use 15ms on w2k and make win98 users suffer 20fps with the 50ms res timer. I tried (and succeeded) using my own timers but that means I can't sleep (as sleep>0 will sleep for at least the timer resolution) so my cpu usage is on 99%. And it destroyed my win98 machine :-)
3) Has anyone had problems with ImageIO.read in an applet? I find that occasionally when reading an image from my web server, it reads it twice (I guess it found an error and re-requests it) and corrupts the image. At first I thought it was my php corrupting the image, but it does it on direct accesses as well. Toolkit.createImage does not seem to have this problem (but then I have to wait for it to load (currently i construct a cursor with the image which seems to sort it) and then paste it to BufferedImage rather than the inaccessible image type returned by toolkit). Toolkit does however have the advantage that I can use extensionless image files and prevent caching though which ImageIO.read seems unable to handle (it usually loses the palette of gifs etc without the extension hint). My web server is apache 2.0.45 on Win2K btw.
These issues concern APPLETS. If i wanted to write an application, I would use C++ and OpenGL with very little extra work required for each specific platform (I'd only support PC, Mac and x86 based linux anyway). The point is that i want it embedded on a web page, and I don't want the user to have to install anything other than the Java VM.
What about the rest of you?
What are your experiences with Java? Good? Bad?
Do you guys think there is any future for it?
Does Java 1.5 have anything to offer?
IF it comes down to it, and I NEED to sign my code and INSTALL code then I will just abandon Java altogether and just stick to windoze users (It will take a fraction of the development time and be far less painful for me to use ActiveX or .net).
Oh, and if you're just going to reply and say something like "I think Java's the bestest thing ever, it's so much better and cooler than C++ and all my friends think so too. Cos my teacher says so" then don't waste my time.
If you have games experience and know what you're on about then I'd love to hear your views.
<END RANT>
Cheers
-SimonHi Paul,
Thanks for your views.
Badly because it provides the security protections it
says it does?No, I mostly appreciate the security but some things seem a little too secure. For example, I want to use hardware acceleration for my translucencies but Java won't let me....
You can always ask users to change the permissions
your applet runs under, I guess, assuming the browser
support it. But at that point, why not just write
your game in C++ and tell people to download it and
run it normally?
If you're trying to write a Quake clone in java and
distribute it as an applet...don't bother.The point is that I don't want to do this. I want ppl to have to visit the web site to play the game without having to grant permissions or install anything or agree to run signed code (not just for advertising purposes but also as some of the games will be multiplayer). This is why I'm using Java and not activeX or .net.
I am perfectly capable of writing any genre of game to be cross platform in C++ (if I use OpenGL then I only need a thin platform-specific wrapper and I just compile it for my required targets - PC, Mac, x86 Linux), and I really don't see the point in attempting it as a Java application. The games I'm currently doing for my website in Java are simple 2d games suitable as applets. The main problem I'm having is that I need to sleep to free up the cpu, but the low-res timer resolution means that I can only run at 20fps on win98 when sleeping. Yes it runs ok, but by no means as smooth as I'd like.
I think java may be used in action gaming once it's
embedded into an environment that really supports it
(e.g., as a well-supported programming environment for
PlayStation 2) (and somehow I doubt that OpenGL
bindings for java will work as a gaming environment,
although that's just a hunch), and it's fine for
non-action games.Yes it can do the job, but the fact is that Java is and always will be slower than code compiled directly for the target CPU so this means my entire audience need to have higher spec machines to run it than I'd like. I would not write anything that is too CPU intensive in Java as there are also still a lot of low spec machines out there running win98 which I (unlike most ppl on these forums) am still willing to support.
Cheers
-Si -
Java is capable to render 3D applications!!!
I often heard that java is slow, to slow to use it for bigger 3D applications.
I don't think that's right! Well, now I tested it!
Screen:
http://www.pictureupload.de/originals/9417/030609172251_3d_screen01.jpg
Realtime 3D Applications with shaders, light, shadows, whatever are no problem with java. I'm just wondering, why nobody use java for 3D games??
I can understand, if someone say, C++ is faster, but java is platform independent and as I tested, fast enough for nice games.of course it is no problem for java, because java doesn't deal with that stuff. It is handled by the NATIVE underlying 3D API and drivers, plus the video hardware does all the work anyway. There are already two solid OpenGL bindings for Java through JOGL and LWJGL. I'm sure a Direct3D version will also come eventually.
The trick with java game development is not in the graphics department but more in memory management (stay inside a theoretical low max heap space, minimize the number of objects being created/released during a frame cycle, etc.) and efficient networking I/O. Next to that debugging a bad OpenGL call is harder to do than in C++, because it usually causes the native binary to crash, leaving you only with a crash report and no stacktrace.
But I must say, what you can do in C++ in two weeks, you can do in Java in one week. It really does make game development a whole lot easier IMO. Or I just suck at doing proper C++ of course :) -
Wow, i tried the tutorial w/o success
I copied the code into a file to play with to see what I could figure out.
below is my failed attempt at getting it to compile. and below that are my errors.
it doesn't recognize the javax.media.j3d or com.sun.j3d.utils
//import Program Files\Java\j2re1.4.0_01
import javax.media.j3d;
import com.sun.j3d.utils;
import java.awt;
import javax.vecmath;
public class HelloJava3Da extends Applet
///////////////////////////////class constructor//////////////////////////////
public HelloJava3Da()
setLayout(new BorderLayout());
GraphicsConfiguration config = simpleUniverse.getPreferredConfiguration();
add("Center", canvas3D);
BranchGroup Scene = createSceneGraph();
scene.compile();
SimpleUniverse simpleU = new simpleUniverse(canvas3D);
simpleU.addBranchGraph(scene);
//////////////////////////////Main////////////////////////////////////////////
public static void main( String args[] )
Frame frame = new MainFrame(new HelloJava3Da(), 256, 256);
//////////////////////////////Methods/////////////////////////////////////////
public BranchGroup createSceneGraph()
BranchGroup objRoot = new BranchGroup();
objRoot.addchild(new ColorCube(0.4));
return objRoot;
}following are my errors.
HelloJava3Da.java [2:1] package javax.media does not exist
import javax.media.j3d;
^
HelloJava3Da.java [3:1] package com.sun.j3d does not exist
import com.sun.j3d.utils;OK, for all of those who find my question interesting..... I don't know what my problem was. I just now searched for 1 minute and found the answers I needed.
Developing and using Java3D (using OpenGL):
you need java3D-sdk ___ http://java.sun.com/products/java-media/3D/1.1.3/download.html
You also need OpenGL ( http://www.opengl.org/ )
Using Java3D:
you need java3D jre (samne website... java3d1_1_3-win-opengl-rt.exe, 1.83 MB)
And of course OpenGL.
Greetings,
Q -
New Features in JavaFX 2.2
Hi All,
Greetings!
JavaFX 2.2 is released !! :)
Can some one provide a detailed list of new changes which are included in this release.
Thanks in Advance !! :)
Thanks & Regards,
Sai Pradeep DandemA list of 2.2 features from jira:
RT-19841 Add tests to verify getting/setting different event handlers for scene and that they work
RT-19515 Support Mac OS 10.7 (Lion) with browser support
RT-19375 Pagination UI Control
RT-19370 Virtual Keyboard: Input Method Constraints
RT-19302 Gtk: createAppletWindow() fails in Glass on Linux
RT-19155 SQE: develop tests and testplan for HTTP Live Streaming support
RT-19132 SQE: develop tests and testplan for Support Mac OS 10.7 (Lion) with browser support
RT-19128 SQE: develop tests and testplan for Linux with browser support
RT-17407 Canvas Node
RT-17398 Render to image (snapshot) support
RT-17388 Mac Core Animation Layer
RT-12663 DnD and Clipboard support for embedded scenes (e.g. JFXPanel)
RT-21218 Ensemble: Add example of List with Customized cells
RT-20529 Need a way to know currently focused component
RT-20398 Mac: List of open windows in the dock icon menu
RT-20364 Multi-touch events
RT-20362 Swipe event
RT-19452 TableView: Item renderers and item editors
RT-19449 TableView: Improved keyboard navigation (discontinuous selection)
RT-19369 Enable full screen apps on Mac OS X Lion
RT-19312 Color Picker control
RT-19042 Add fontSmoothingType API to WebView
RT-19034 Rewrite prism-es2 pipeline to not use OpenGL bindings
RT-18982 Mac: Support the Enter Full Screen window title-bar button on Mac OS X Lion 10.7
RT-18980 Provide a Browser History API
RT-18911 Provide API for checking for transparent window support
RT-18710 Common gestures API
RT-17577 packaging: add support for app parameters to the double clickable jars
RT-17409 Image Ops
RT-16742 Add support for 100% width and height applets
RT-14909 It should be possible to customise the TableColumn header area more
RT-6917 Add ImagePattern to the Public API as part of the common profile
RT-23056 Ensemble: add tableview cell factory sample
RT-22628 Private API for WebView scaling
RT-22556 Ensemble: Add ColorPicker sample
RT-22470 Ensemble: Add pagination sample
RT-22005 Mention ContextMenuEvent in MouseEvent and KeyEvent
RT-21932 SQE: develop tests for feature TextField/PasswordField/TextArea undo/redo
RT-21233 Ensemble: Improve Interpolators sample
RT-21188 Add event delivery methods to FXWindow
RT-21052 Support touch events in WebView
RT-20837 Support HTML5 Drag-n-Drop
RT-20354 Provide tutorial for new Canvas API
RT-20353 Document Best Practices as shown in DataApp
RT-20292 packaging: document support for app parameters to the double clickable jars
RT-19983 Document JS-to-Java bridge
RT-19865 WebView: Tab Key navigation between hyperlinks and Enter to activate
RT-19837 Add tests that use DepthTest class
RT-19779 Add tests that verify edit start/commit/cancel action handlers
RT-19531 SQE: develop tests and testplan for Pagination control
RT-19492 Let fx:deploy ant task optionally generate pre-FX jnlp format to support FX-in-Swing WebStart applications and applets
RT-19446 Add ability to co-bundle Java + JavaFX + App into a single native executable
RT-19262 Allow customization of Web component
RT-19154 SQE: develop tests and testplan for Enhancements to the TableView Control
RT-19153 SQE: develop tests and testplan for Multi-touch support
RT-19152 SQE: develop tests and testplan for Allow customization of Web component
RT-19151 SQE: develop tests and testplan for We Browser History
RT-19150 SQE: develop tests and testplan for Render scene to image
RT-19148 SQE: develop tests and testplan for Scaling UI Controls down to QVGA
RT-19146 SQE: develop tests and testplan for No FX dependency on AWT or Swing
RT-19145 SQE: develop tests and testplan for Support Input Method Constraints
RT-19143 SQE: develop tests and testplan for UI Controls support touchscreen input down to VGA screens
RT-19141 SQE: develop tests and testplan for Support Touch Control - One Finger Swipe in UI Controls
RT-19140 SQE: develop tests and testplan for Core JavaFX module(s) must not require any modules outside of core Java SE modules
RT-19136 SQE: develop tests and testplan for color Picker control
RT-19134 SQE: develop tests and testplan for Enable full screen apps on Mac OS X Lion
RT-19130 SQE: develop tests and testplan for Canvas Node
RT-18533 Supply a Path constructor which accepts collections
RT-18400 Support cross build for Linux embedded
RT-18291 Image class should recognize a URL beginning with a leading slash as relative to the classpath
RT-18277 Improve FXML Login demo
RT-18194 SQE: Implement Test plan and specification for dmg installer for FX 2.2
RT-17975 Support for discontinuous selection in ListView and TreeView
RT-17740 Provide FXML-friendly way in the API to specify "clamped" and "unbounded" resizable nodes
RT-17438 Add key classification to KeyEvent
RT-15684 WebView: Make context menu optional
RT-15008 Add switch to WebEngine to turn JavaScript on/off
RT-14436 Allow CSS styling for WebView
RT-520 Add "localToParentTransform" and "localToSceneTransform" variables to Node.fx -
JavaFX 2.2 release date??
Can somebody let me know when JavaFX 2.2 is going to be released?
Also it shall be helpful if somebody can state the modifications (at high-level) in JavaFX 2.2 from 2.1.Can somebody let me know when JavaFX 2.2 is going to be released? 2.2 is feature complete, there are still a bunch of QA to be done and issues which need to be fixed.
Roadmap would put it going GA a couple of months out (by non-expert, outsider, eyeball estimate).
http://www.oracle.com/technetwork/java/javafx/overview/roadmap-1446331.html
Also it shall be helpful if somebody can state the modifications (at high-level) in JavaFX 2.2 from 2.1.More low level than high level, but I'll let you work out the high level things from the list of features which have been implemented (closed as fixed) for 2.2 from the (public) jira.
RT-520 Add "localToParentTransform" and "localToSceneTransform" variables to Node.fx
RT-6917 Add ImagePattern to the Public API as part of the common profile
RT-12663 DnD and Clipboard support for embedded scenes (e.g. JFXPanel)
RT-14436 Allow CSS styling for WebView
RT-14909 It should be possible to customise the TableColumn header area more
RT-15008 Add switch to WebEngine to turn JavaScript on/off
RT-15684 WebView: Make context menu optional
RT-16742 Add support for 100% width and height applets
RT-17388 Mac Core Animation Layer
RT-17398 Render to image (snapshot) support
RT-17407 Canvas Node
RT-17409 Image Ops
RT-17438 Add key classification to KeyEvent
RT-17577 packaging: add support for app parameters to the double clickable jars
RT-17740 Provide FXML-friendly way in the API to specify "clamped" and "unbounded" resizable nodes
RT-17975 Support for discontinuous selection in ListView and TreeView
RT-18291 Image class should recognize a URL beginning with a leading slash as relative to the classpath
RT-18400 Support cross build for Linux embedded
RT-18533 Supply a Path constructor which accepts collections
RT-18710 Common gestures API
RT-18911 Provide API for checking for transparent window support
RT-18980 Provide a Browser History API
RT-18982 Mac: Support the Enter Full Screen window title-bar button on Mac OS X Lion 10.7
RT-19034 Rewrite prism-es2 pipeline to not use OpenGL bindings
RT-19042 Add fontSmoothingType API to WebView
RT-19128 SQE: develop tests and testplan for Linux with browser support
RT-19130 SQE: develop tests and testplan for Canvas Node
RT-19132 SQE: develop tests and testplan for Support Mac OS 10.7 (Lion) with browser support
RT-19134 SQE: develop tests and testplan for Enable full screen apps on Mac OS X Lion
RT-19136 SQE: develop tests and testplan for color Picker control
RT-19140 SQE: develop tests and testplan for Core JavaFX module(s) must not require any modules outside of core Java SE modules
RT-19141 SQE: develop tests and testplan for Support Touch Control - One Finger Swipe in UI Controls
RT-19146 SQE: develop tests and testplan for No FX dependency on AWT or Swing
RT-19150 SQE: develop tests and testplan for Render scene to image
RT-19151 SQE: develop tests and testplan for We Browser History
RT-19153 SQE: develop tests and testplan for Multi-touch support
RT-19154 SQE: develop tests and testplan for Enhancements to the TableView Control
RT-19302 Gtk: createAppletWindow() fails in Glass on Linux
RT-19312 Color Picker control
RT-19369 Enable full screen apps on Mac OS X Lion
RT-19370 Virtual Keyboard: Input Method Constraints
RT-19375 Pagination UI Control
RT-19446 Add ability to co-bundle Java + JavaFX + App into a single native executable
RT-19449 TableView: Improved keyboard navigation (discontinuous selection)
RT-19452 TableView: Item renderers and item editors
RT-19492 Let fx:deploy ant task optionally generate pre-FX jnlp format to support FX-in-Swing WebStart applications and applets
RT-19515 Support Mac OS 10.7 (Lion) with browser support
RT-19531 SQE: develop tests and testplan for Pagination control
RT-19779 Add tests that verify edit start/commit/cancel action handlers
RT-19837 Add tests that use DepthTest class
RT-19841 Add tests to verify getting/setting different event handlers for scene and that they work
RT-19865 WebView: Tab Key navigation between hyperlinks and Enter to activate
RT-19983 Document JS-to-Java bridge
RT-20292 packaging: document support for app parameters to the double clickable jars
RT-20362 Swipe event
RT-20364 Multi-touch events
RT-20398 Mac: List of open windows in the dock icon menu
RT-20529 Need a way to know currently focused component
RT-20837 Support HTML5 Drag-n-Drop
RT-22005 Mention ContextMenuEvent in MouseEvent and KeyEvent -
Any opinions about OpenGL4Java?
Any opinions about OpenGL4Java? I want to make a 3D game in Java using OpenGL. OpenGL is for C++, but there is a package or something called OpenGL4Java (I think it is put out jau software, ore soemthing like that, I don't have time to look it up now. Anyway, does anybody have any opinions about it?
And for all those who say that a good game cannot be done in Java, take a look here:
http://www.cosm-game.com/
It looks good for Java. Too bad it is only an online game.
VirumDo you have any evidence for that?
That sounds really accusative, but I'm genuinely
interested in seeing some comparisons between the two
environments.I assume you are talkin about Java3D and OpenGL?
If so yes, I can give some evidence. My uncle knows a pofessional that has been working with graphics programming since he was twelve. I think he is somewhere around 29, but I don't know. Anyweay he uses uses OpenGl quite a bit, and he waas the one who told me that OpenGL gave much more control (it has direct access to hardware) than Java#D. Java#D may have now reached OpenGL's speed, but I don't think it has yet. ANyway, I want the control OPenGL gives you.
Has anybody else had any expereiences with both?
As to the portability thing, I have no idea where I heard Java#D had portability probelems. -
Is Software Rendered 3D w/ Z-Buffer Feasible?
Ive seen some awesome 3D Java games using OpenGL bindings -
so this is by no means any sort of "can you do games in java" question.
Ive programmed Doom style examples from java game books that use BSP.
Is it possible to get 20+ fps in Java using pure software rendering and a z-buffer?
A lot of the engines like jME use OpenGL so its hard to get a feel for how far
I can push a pure Java game engine.
Ive created a 3D modeling program and it gets bad repaint times and all im using
is backface culling.Is it possible to get 20+ fps in Java using pure software rendering and a z-buffer?Yes, but it's a crazy question. This would depend on how many objects you have, hardware resources (aside from graphics card), etc. My question is why would you want to do this? I don't think a computer has been sold in 10 years that doesn't come with a 3D accelerated card (unless you're buying servers or whatever)
-
Model rendering and...
Ok first i have 2 questions, i originally started a 3d game engine, the model rendering current is done using alot of algorithms and using the java.awt.Graphics class to draw polygons (triangles).
I know how a model works obviously, vertices and faces, but i need to know if Java3D offers any easy solutions to drawing a 3d model which will work with rotations and texturing.
My current Model rendering system does the following;
Loads the model's and created a class instance called "Face" which contains; 3 vertice points, colour, texture etc.
Then loops through them using javas Comparator class to order them according to z axis (so it draws the back faces before the front ones).
And that is basically it, but is there a simple solution to doing this, including basic lighting in the java's media api?
Now, my second question:
How do i download and install the javax.media.opengl package, ive been googling and checking the sun main site for downloads for that api but i can't seem to find them.
Thanks for any help to any of the questions above.If you want to use complex models , I think the best way is to use 3d object loaders .
You must design your model in some high level 3d tool like maya or 3d studio max , and then export object . then you can have your model in your game!
Java3d for OpenGl :
http://java3d.j3d.org/download.html -
Opengl and directx for java or c++ or Java3D
I am new to the 3D programming and I have many queries and I hope those expect can answer me. Thank you very much.
I have some experience in writing directx 7.0 in C++. I find that the IDirect3DDevice7 in directx7.0 does not support 256 colors but direct3ddevice in directx5.0 does.
However, the direct3ddevice in directx5.0 in 16 or 32 bit color performs very strange. Distortion is found in displaying a 3D image.
1. Do you have this experience? Does direct3ddevice in directx5.0 not work in 16 or 32 bit colors?
2. If I want to write a 3D directx program in C++ that can be work in every resolution, what can I do?
3. Can opengl work in every resolution 256 colors, 16, 32 bits?
4. Does opengl work in every platform?
5. Can I write an opengl program in window platform and run it in Linux without any modification or compilation ?
6. Does the opengl runtime different from platform to platform ?
7. If I deploy an opengl progam, do I need to deploy the runtime for a particular platform with it.
8. Opengl is claimed to be open source. What does it mean ? Can I modify the code of the opengl sdk or runtime and re-complie it and make it my own version of opengl ?
9. I find many version of opengl sdk in the web. Some is special to a particular hardware eg. NVIDIA. Some is not bounded to any hardware. What is the different between them ? How can I choose from them ?
10. I know that there is directx for java and opengl for java. Is it the so called java 3D ?
11. Does opengl or directx together with Java2 become Java 3D ?
12. However I cannot find any directx code or directive for importing the directx package in the Java 3D sample code.
13. Does the Javax provide the utility for 3D programming by hiding the 3D device or texture surface creation ?
14. I find some code segment from MSDN which shows the way to create a directdraw object in an applet. I wonder what is the proper way to use directx or opengl in java since my main goal is to create a directx application that can be worked in the web.
15. Lastly, from my understanding, directx is a com api which can be used in every programming languages. Does it imply that with a directx sdk, I can write a directx application in C++, java, or vb ?
16. But, I find that the code to do the same task in the three programming languages is very different. The object creation methods, the data structure for directx in the three programming languages is different. Is the same sdk realy used in different programming languages ? The object name for e.g. direct3ddevice is different from vb (Direct3DDevice7) and c++ (IDirect3DDevice7).I'm no expert in 3D graphics programming, but I have some experience. I'll try to answer some of your questions.
2. If I want to write a 3D directx program in C++ that
can be work in every resolution, what can I do?I think both DirectX and OpenGL supports any resolution and color depth. It's more a matter of which resolutions your graphics driver supports.
3. Can opengl work in every resolution 256 colors, 16,
32 bits?Yes.
4. Does opengl work in every platform?OpenGL is available on many platforms. Look at GL4Java if you want to use OpenGL in Java, it's available on many platforms. Look at: http://www.jausoft.com/gl4java.html
5. Can I write an opengl program in window platform
and run it in Linux without any modification or
compilation ?Yes, if you write it in Java. In C++ you will need to recompile the app.
6. Does the opengl runtime different from platform to
platform ?No, it's a standard. There are some extensions that are driver dependant, but if you stick to the standard it will run unmodified on all platforms.
7. If I deploy an opengl progam, do I need to deploy
the runtime for a particular platform with it.I don't think OpenGL is available by default on all platforms.
8. Opengl is claimed to be open source. What does it
mean ? Can I modify the code of the opengl sdk or
runtime and re-complie it and make it my own version
of opengl ?OpenGL is not open source. OpenGL is a standard, it can't be open source since there is no source code.
9. I find many version of opengl sdk in the web. Some
is special to a particular hardware eg. NVIDIA. Some
is not bounded to any hardware. What is the different
between them ? How can I choose from them ?If you have modern graphics card the driver includes support for OpenGL on MS Windows. For Linux you use Mesa I think. See GL4Java homepage for more info.
10. I know that there is directx for java and opengl
for java. Is it the so called java 3D ?GL4Java implements the OpenGL functions in Java. Java3D is a high level API that runs on either OpenGL or DirectX.
11. Does opengl or directx together with Java2 become
Java 3D ?No. The Java3D package is available for download at java.sun.com.
12. However I cannot find any directx code or
directive for importing the directx package in the
Java 3D sample code.You can't call DirectX directly in Java3D. It hides the underlying layers.
13. Does the Javax provide the utility for 3D
programming by hiding the 3D device or texture surface
creation ?Java3D is platform independent and hides things like the hardware, drivers etc.
14. I find some code segment from MSDN which shows the
way to create a directdraw object in an applet. I
wonder what is the proper way to use directx or opengl
in java since my main goal is to create a directx
application that can be worked in the web.I dont know if DirectX is available for Java. I recommend that you use OpenGL instead, or Java3D if you want an easy, high level API.
15. Lastly, from my understanding, directx is a com
api which can be used in every programming languages.
Does it imply that with a directx sdk, I can write a
directx application in C++, java, or vb ?In C++ and VB, yes. Dont know if there are any Java DirectX bindings available.
16. But, I find that the code to do the same task in
the three programming languages is very different. The
object creation methods, the data structure for
directx in the three programming languages is
different. Is the same sdk realy used in different
programming languages ? The object name for e.g.
direct3ddevice is different from vb (Direct3DDevice7)
and c++ (IDirect3DDevice7).Don't mix programming languages in the same app. Decide if Java or C++ is the right language for you, then use the tools available for the language you choose.
My recommendation is to go for Java and Java3D if you are inexperienced with 3D graphics programming. Use Java + OpenGL if you know about vertices, textures, transforms etc. -
Installing java3d opengl version?
i have my java j2sdk1.4.2_04 installed in the root of c:
i have j2re1.4.2_03 installled in the following location C:\Program Files\Java
i installed the java3d-1_3_1-windows-i586-opengl-sdk package, and when it asked for my install directories, it automatically picked my above locations that the sdk and jre were installed to in the prior installation. the install notes says
>
Setting CLASSPATH
If Java 3D is installed into the JDK or JRE, you do not need to include the Java 3D jar files in your CLASSPATH, nor do you need to include the Java 3D shared libraries in your PATH or LD_LIBRARY_PATH. You should include "." in your CLASSPATH or ensure that CLASSPATH is not set.
[\quote]
but when i try to compile the following code in netbeans 3.6, it will not complete the compile does anyone know what i did wrong?
//import Program Files\Java\j2re1.4.0_01
import javax.media.*;
import com.sun.j3d.utils;
import java.awt.*;
import javax.vecmath;
public class HelloJava3Da extends Applet
///////////////////////////////class constructor//////////////////////////////
public HelloJava3Da()
setLayout(new BorderLayout());
GraphicsConfiguration config = simpleUniverse.getPreferredConfiguration();
add("Center", canvas3D);
BranchGroup Scene = createSceneGraph();
scene.compile();
SimpleUniverse simpleU = new simpleUniverse(canvas3D);
simpleU.addBranchGraph(scene);
//////////////////////////////Main////////////////////////////////////////////
public static void main( String args[] )
Frame frame = new MainFrame(new HelloJava3Da(), 256, 256);
//////////////////////////////Methods/////////////////////////////////////////
public BranchGroup createSceneGraph()
BranchGroup objRoot = new BranchGroup();
objRoot.addchild(new ColorCube(0.4));
return objRoot;
}with the following errors
HelloJava3Da.java [2:1] package javax.media does not exist
import javax.media.*;
^
HelloJava3Da.java [3:1] package com.sun.j3d does not exist
import com.sun.j3d.utils;
^
HelloJava3Da.java [5:1] package javax does not exist
import javax.vecmath;
^
HelloJava3Da.java [7:1] cannot resolve symbol
symbol : class Applet
location: class HelloJava3Da
public class HelloJava3Da extends Applet
^
HelloJava3Da.java [31:1] cannot resolve symbol
symbol : class BranchGroup
location: class HelloJava3Da
public BranchGroup createSceneGraph()
^
HelloJava3Da.java [12:1] cannot resolve symbol
symbol : method setLayout (java.awt.BorderLayout)
location: class HelloJava3Da
setLayout(new BorderLayout());
^
HelloJava3Da.java [13:1] cannot resolve symbol
symbol : variable simpleUniverse
location: class HelloJava3Da
GraphicsConfiguration config = simpleUniverse.getPreferredConfiguration();
^
HelloJava3Da.java [14:1] cannot resolve symbol
symbol : variable canvas3D
location: class HelloJava3Da
add("Center", canvas3D);
^
HelloJava3Da.java [16:1] cannot resolve symbol
symbol : class BranchGroup
location: class HelloJava3Da
BranchGroup Scene = createSceneGraph();
^
HelloJava3Da.java [17:1] cannot resolve symbol
symbol : variable scene
location: class HelloJava3Da
scene.compile();
^
HelloJava3Da.java [19:1] cannot resolve symbol
symbol : class SimpleUniverse
location: class HelloJava3Da
SimpleUniverse simpleU = new simpleUniverse(canvas3D);
^
HelloJava3Da.java [19:1] cannot resolve symbol
symbol : class simpleUniverse
location: class HelloJava3Da
SimpleUniverse simpleU = new simpleUniverse(canvas3D);
^
HelloJava3Da.java [19:1] cannot resolve symbol
symbol : variable canvas3D
location: class HelloJava3Da
SimpleUniverse simpleU = new simpleUniverse(canvas3D);
^
HelloJava3Da.java [20:1] cannot resolve symbol
symbol : variable scene
location: class HelloJava3Da
simpleU.addBranchGraph(scene);
^
HelloJava3Da.java [27:1] cannot resolve symbol
symbol : class MainFrame
location: class HelloJava3Da
Frame frame = new MainFrame(new HelloJava3Da(), 256, 256);
^
HelloJava3Da.java [33:1] cannot resolve symbol
symbol : class BranchGroup
location: class HelloJava3Da
BranchGroup objRoot = new BranchGroup();
^
HelloJava3Da.java [33:1] cannot resolve symbol
symbol : class BranchGroup
location: class HelloJava3Da
BranchGroup objRoot = new BranchGroup();
^
HelloJava3Da.java [34:1] cannot resolve symbol
symbol : class ColorCube
location: class HelloJava3Da
objRoot.addchild(new ColorCube(0.4));
^
18 errors
Errors compiling HelloJava3Da.thanks for responding to my prior request.
i have a few more fu questions.
Is the following module required for java3d in netbeans?
http://java3d.netbeans.org/module_intro.html
Can i use the normal javac and java w/o mounting the class directory?
if I did want to mount the directory for the java3d classes, what directory would it be?
Is there a default folder in the jsdk that holds all classes, including the new installed j3d?
what is in the following directory? it looks like to a package directory located on a remote server, or a package located on the system that originally compiled the code.
As for mounting the class folder or class itself, would you be so kind to provide me with a j3d class mounting for dummies? I understand ide's and i'm getting decent at java, but j3d is still a marval.
import com.sun.j3d.utils;sorry for all the questions, but thank you for the help.
Maybe you are looking for
-
10.4.8 - and now the remote doesn't work
I downloaded the 10.4.8 update via Software Update and then restarted the machine. It had a few false starts when starting-up, seeming to sleep before starting again, but then it worked fine. I repaired permissions and everything seemed to be working
-
How to restrict the default selection of first row in ALV in Webdynpro
Hi Experts, In webdynpro i used ALV to display the bulk amount of datas under a view container. While running it ll cme by default selection on first row. how to restrict that.....
-
Can somebody help me with this syntax? I am taking two working queries and putting them together such that one becomes a derived column in the other. I am guessing that I must just be missing some small syntax point (I don't use Oracle much) because
-
Render component based on pageTemplateDef facetRef's child
hi. I have Page Template and inside that template I has a component which has (somewhere deep inside) one facetRef. I want to toggle render property of that component based on this facetRef's cild. In other words if facetRef has a child I want to ren
-
How do you get rid of ! symbols?
my computer crashed so I re-installed iTunes and then re-loaded my mp3 files to my hard drive using option 2: http://discussions.apple.com/thread.jspa?threadID=879353&tstart=60 now I am getting ! in my library list Can anyone help? thank you christin