VTK object coloring by Data Array support in XTK? - xtk

Does XTK support object coloring by data array parsed from VTK file? I Believe the parser does read these arrays but i haven't found a way to apply those to an object.
Will or could this be supported in future versions of XTK?
Kimmo

You are right - the feature is not there yet and targeted for release 4 (4/12/12). We would welcome any contributions regarding this important feature :)
The infrastructure on the X.object side is already there: X.object.colors which associates a color to each vertex.
Cheers!

Related

Transfer Functions in xtk

How would I go about plugging in a transfer function to determine coloring and opacity in xtk based on pixel scalar intensity and / or gradient magnitude. This may be a separable 1d transfer Functions or a 2d transfer function. In addition to VTK, ImageVis3D also supports this.
There is no built-in support in XTK for that and is most likely not gonna happen.
We recommend using ami.js - there is no built-in support for 2D transfer functions in in ami.js yet but it is under active development and should provide most of required functionalities to support this feature.
Hope that helps -

The best way to export 3d mesh animation in order to use it in OpenGL

Suppose that I have a 3d model with animation in, say, Blender. I need to export this model to some file and then use it in OpenGL app, i.e. without hardcoding animations, but reading them from file. What format is the best solution?
OpenGL doesn't support any format directly, but the classic OBJ file format lines up very well with drawing with vertex arrays. Basically, OBJ lists all vertices independently of the geometry. This way, several objects can share the same points. All kinds of groupings are also possible.
Also, it is one of the earliest formats to support a wide range of spline curves & surfaces, including Bezier, B-Splines & NURBS.
A basic decription can be found here:
http://en.wikipedia.org/wiki/Wavefront_.obj_file
The complete OBJ spec can be found here:
http://www.martinreddy.net/gfx/3d/OBJ.spec
It's not as modern as WebGL, but it's simple, human readable and widely supported.
What format is the best solution?
OpenGL doesn't care about file formats. So feel free to choose whatever suits your needs best. Due to the rise of WebGL I started dumping whole Blender scenes into collections of JSON formated files.

Creating SVG image in c++

I want to create a SVG image programmatically using preferably c++ from some image points. Can anyone help me with that?
simple-svg is a header only svg lib easy to use:
simple_svg_1.0.0
Here is an example how to use it: main_1.0.0.cpp
It is also hosted on GitHub.
You could check out LibBoard. I have no experience with it myself, so I can't vouch for its usefulness, but it does appear to be what you're looking for. I'm not sure how complicated your target image is going to be, but the website states:
For now, LibBoard can handle primitives like lines, rectangles,
triangles, polylines, circles, ellipses and text.
In future releases, bitmap insertion should be supported.
See the TODO file for a list of features that should be added in future releases.
So you'll have basic functionality from it, and you can probably mess around with the basic list of shapes to create some pretty complicated images.
I used GraphViz to do that, using 'dot' language, check it out.

facial animation

I am developing a 3d facial animation application in java using opengl(jogl) i had done the animation with morph targets and now i am trying to do a parametrized facial animation .
I can't attach the vertex of the face with the appropriate parameter,for example i have the parameter eyebrow length ,how could i know wish are the vertex of the eyebrows (face features),please please could anybody help me i'm using obj file to read the face model and face gen to create it.
I appreciate your help .
For each morph target you assign each vertex a weight, how strong it is influenced by the respective morph target. There's no algorithmic way to do this, this must be done manually.
Lightwave OBJ file format may not be ideal for storing the geometry in this case, since it lacks support for storing such auxiliary data. You may extend the file format, however this will probably clash with programs expecting a "normal" OBJ.
I strongly suggest using a format that has been designed to support any number of additional attributes. You may want to look at OpenCTM.

Importing Models Into A OpenGL Project

I am taking an OpenGL course and we have the option to create models to use in our assignments with a 3D modeling application, like Maya or Blender.
I am not looking forward to typing in coordinates manually so I was curious what resources I should be looking into for writing OpenGL code and importing models. (Textures are coming later). I am also concerned by the scale I'm importing at but maybe that's silly to worry about at this point.
Thanks for any resource suggestions. OpenGL has so much out there I get overwhelmed sometimes when Googling for what I need.
EDIT:
This is what I ended up using.
http://www.spacesimulator.net/tut4_3dsloader.html
I downloaded the "Windows" version and with a few path changes to the includes, got up and running. It doesn't handle OBJ files but rather 3DS. Cheetah 3D exports to this type as well.
Blender can save files in .obj format, and a simple google search turns up several libraries for loading this into OpenGL. Here is one.
One of the simplest formats that can be used to export meshes is Wavefront OBJ (please search for it on Wikipedia as I'm only allowed to post one link at the moment). It's basically a text file that shouldn't be too hard to parse.
Or actually, if you're allowed to use GLUT, you could try and use its loader (as answered in OpenGL FAQ 24.040)
Don't worry about the object scale at the moment, you can always scale your object later. Just make sure you export it with local coordinates, not global (e.g. [0,0,0] should be the center of the object, not the world you're modelling).
I'd suggest not worrying about the scale of the objects for right now.
Now, the thing you're going to have to do is settle on a format for the 3D file. There are MANY options when exporting from a 3D program like Maya or Blender.
Might I recommend attempting a simple COLLADA importer. Specification information is here:
http://www.khronos.org/files/collada_spec_1_4.pdf
Another spec I've been using lately would also probably be suitable for this is OBJ.
The specification for OBJ is located here:
http://local.wasp.uwa.edu.au/~pbourke/dataformats/obj/
Also, there are several free sample 3D OBJ files located here. This will allow you to see the format of the files and really see how easy they can be to parse.
Keep in mind, OBJ can not support animation, and it is rather inefficient for rendering large scenes.
I'd say that the Obj format is a good balance for readability and functionality if you want to parse it yourself.
http://en.wikipedia.org/wiki/Obj
The easiest way would to be to find a library to do it for you but the possibilities would be limited to your chosen language.
You shouldn't be worrying about scale. OpenGL's matrices can easily rescale vertices.