Announcing Simple3D (http://fivedots.coe.psu.ac.th/~ad/Simple3D/)
Simple3D simplifies Java 3D in a few ways: 1) It automatically builds the top-level scene graph for a program, adds a background, a set of lights, an optional floor grid and x-, y-, z- axes. The camera allows both mouse-based and key-based navigation. 2) The scene is automatically displayed in a JFrame. A menu bar includes a item for taking screenshots, information about the camera controls, and resetting the camera position. 3) Simple3D contains an ever-growing collection of static methods for common tasks: * scene graph node creation; * applying colors and textures; * loading, examining, and saving OBJ models; * translating, rotating, and scaling; * common forms of animation; * using vertex and fragment shaders. Please download it, and try out the examples. I've only just started this project, so I'd love to get feedback. |
Administrator
|
Good job. Do you plan to convert the PDF files into HTML pages? You can use PDF2HTML or do it manually.
Julien Gouesse | Personal blog | Website
|
In reply to this post by Andrew2563
Andrew,
That's fantastic work! I love the idea of it, now you've done it is seems obvious in retrospect, Java3D is a wonderful tool for teaching the working of all game engines, but still one level too deep. When you mentioned your book I looked up and can see it on my bookshelf, I really loved reading that all those years a ago, it fired my interest in Java3D and game engine mechanics. I tried running the examples and obviously was far too keen, so I flipped the compile.bat to compile *.java, but the useTetra fails out of the box for me: E:\Java3D\workspace-1.7\Simple3D>compile useTetra.java Compiling useTetra.java with JOGL and Java3D... useTetra.java:24: error: incompatible types: BranchGroup cannot be converted to Shape3D Shape3D tet1 = Simple3D.tetra(1, 1.5, 2, "blue"); ^ useTetra.java:27: error: cannot find symbol Shape3D tet2 = Simple3D.texTetra(1, 4, 1, "images/marble.jpg"); ^ symbol: method texTetra(int,int,int,String) location: class Simple3D 2 errors E:\Java3D\workspace-1.7\Simple3D> I'm just Win10, openJdk 1.7 Well done on this. At some point in your tutorials you may get to be explaining the fixed function versus programmable pipeline differences (once you've thrashed through texture mapping and line drawing, etc). When I learned shader programming I found that there is absolutely nothing (not anything) on the internet for learning the conceptual mapping between fixed and programmable, the only advice is "start from scratch and start coding in GLSL..." Java3D 1.7 supports a programmable only pipeline and will actually build shaders for you (by way of the SimpleShaderAppearance), so you can see how a NodeAttribute changes a vertex shader and then passes data onto a fragment shader. That may be useful when explaining how scene graphs drive shaders. Java3D 1.8 will have multipass rendering as well, it supports a shadow map now. |
Sorry about that. Fixed now.
I really must check back here every day. (I thought I'd checked the alert box.) The TeapotDimples.java example uses shaders. - Andrew |
This post was updated on .
In reply to this post by Andrew2563
Echoing others, this is great work and TY sir!!!!
My efforts with Java3d were meeting with plenty of frustration. Simple3D is a better way to get out of the gate. It is great to have this code and the working examples. Is the source for Simple3D.jar available? Again, Thank you! |
Thanks for the kind words.
If you, or anyone else, has suggestions for additions/changes to Simple3D, please get in touch. I'll be adding more chapters to the website over the coming months, so please check back occasionally for changes. - Andrew |
This post was updated on .
Andrew,
Is the source available for to Simple3D.jar? Shamelessly, I'd like to study how you have done things. (I'm intending to integrate the Java3D into a larger NetBeans, Swing application) TY! |
The JAR file contains all the source code. Just open it as a zip file.
I thought I wrote that somewhere! I need to update the readme.txt file. - Andrew |
Andrew, It has been unzipped and the .java files are there. You probably wrote that, and I probably missed it. TY!
|
This post was updated on .
In reply to this post by Andrew2563
My attempts to get the GLJPanel created by Simple3D to display in a swing JFrame (as created by a NetBeans form) are not working. The Simple3D constructor was modified to accept a JFrame object as a parameter, rather than creating its own JFrame.
The Simple3D constructor creates the GLJPanel then calls initFrame() GLJPanel canvasPanel = initCanvas(); // a JOGL Panel initShaderUniv(); initFrame(frameToUse, title, canvasPanel); initFrame then adds the GLJPanel to JFrame referenced by frameToUse rather than creating its own JFrame. But the graphic does not display. In the same NetBeans app if initFrame() creates the JFrame then that frame displays with the graphic (the rotating Earth example). Does anyone have any thoughts as to why the GLJPanel would not be displaying in the NetBeans form's JFrame? TY, |
I don't have a definite answer, but I wonder if it has something to do with the fact that my code doesn't start the GUI in its own thread using SwingUtilities.invokeLater()?
Perhaps that matters to NetBeans when the JFrame object is created in a diferent function from the GLJPanel? - Andrew |
Free forum by Nabble | Edit this page |