Question about applying Textures with or without a Material, in Java3D.

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about applying Textures with or without a Material, in Java3D.

ZacharyABCD
-In the Java3D model's way of doing things, even including back to version 1.5.2, If you have a 3D Object, comprised
of a series of flat surfaces, was it and is it still the case that you could produce texture coordinates for the relevant vertices of the surfaces, and apply the Textures from those, without generating a default Material object in your own code first anyway, and have everything display and compute in memory correctly?
Reply | Threaded
Open this post in threaded view
|

Re: Question about applying Textures with or without a Material, in Java3D.

philjord
That's an interesting question, your reference to the concept of Material might be slightly different from the division of responsibility in Java3D of the various Node Component objects.

There are 2 paths to consider, the fixed pipeline or the programmable.

If you are interested in a modern programmable pipeline, then you can define a Shader that generates texture coordinates, or if you want it to be automatic then you'll need to look at Java3D 1.7

For the fixed function pipeline:

Java3D has a node called a Shape3D.
Each Shape has one Appearance, and one or more geometries.

Each geometry can must have vertex coordinate data.
Each geometry can optionally have Normals, Colors, and one or more sets of Texture Coordinates.
There are various ways that Normals and Colors are dealt with for defaults when they are not present.

If the Texture Coordinates are not set then you can give the Appearance Node a Component called a TexCoordGeneration object that let's you define how the coordinate are automatically generated.

For Java3D 1.6.0 using the fixed function pipeline there are some truely excellent tutorials on the net for example
here

There's even some youtube tutorials appearing now if that's more you thing:
here

So a short answer is "Yes"

Reply | Threaded
Open this post in threaded view
|

Re: Question about applying Textures with or without a Material, in Java3D.

ZacharyABCD
Thank you very much indeed.  I had at least thought in some part of my brain that Java3D would require at least an empty, or defaulting, Material() object.  No, no, you are quite correct.  You have the Appearance object first, and the Material and/or Texture ones after that.  Thanks!

-If Java3D programming is done without any JOGL classes or calls, say on Windows 10, which of OpenGL or DirectX would it default to?  [This is a question based upon java3D 1.5.2 experience].
Reply | Threaded
Open this post in threaded view
|

Re: Question about applying Textures with or without a Material, in Java3D.

philjord
Generally it's only when people are visualizing scientific or algorithmic data that it matters, most often interesting models are drawn in 3dStudio or Blender or Maya or AC3D or what have you and exported to something like obj files, then imported for use in the Java3D scene graph using the loaders in the utils jar

Of course you need to know about it once you start to put particle effects together or use stencil outlining and cool stuff like that.

Java3D is built on the excellent Jogl back end, which makes all of the required binding s and call to the OpenGL API on teh OS.

So as of 1.6.0 it will definitely use OpenGL.

Do you have any thoughts on whether you need the programmable pipeline? It does sexier things but is no where near as simple to use.
Reply | Threaded
Open this post in threaded view
|

Re: Question about applying Textures with or without a Material, in Java3D.

ZacharyABCD
-As a mathematical and scientific person, of course you would want both pipelines.  Java's abilities
to allow for anything that you could think of as well as anything you couldn't, while having javadocs and being
super organised makes it the kind of advantage it is.

-Of note is the fact that java has it's own internal renderer, along with the fact that it includes multiple file format loading
support for things like wavefront .obj files and many more.

-What's new in version 1.6.0 java3D above version 1.5.2?  What's stencil outlining, anyway?
Reply | Threaded
Open this post in threaded view
|

Re: Question about applying Textures with or without a Material, in Java3D.

gouessej
Administrator
Harvey removed some classes used for backward compatibility with Java < 1.4, Harvey removed Nvidia Cg support, I removed the native pipelines not based on JOGL, Harvey fixed numerous bugs and limitations, some contributors including August and Emmanuel helped to fix some bugs too, I fixed a few bugs in JOGL 2 that were causing some troubles in Java3D. Yes, we'll have to provide release notes...

I don't understand your second paragraph. Each scenegraph API, framework or engine provides its own importer and exporter for various 3D model file formats and you can write your own ones.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Question about applying Textures with or without a Material, in Java3D.

philjord
Zachary,
The Javadocs can be found either as zips here under their respective sub folders, or in the wiki here

To answer your other comment about stencil outlines it is the technique of highlighting a 3d object by using another Shape3D object that shares the same geometry, but has an Appearance that draws oversized color lines, and uses the stencil buffer to ensure it doesn't render over the main image. Like this it's easy to do and makes for a nice result.