From: Stuart Levy To: dinoj@cs.uchicago.edu Date: Fri, 16 Jul 2004 12:06:33 -0500 Subject: Re: quick question Reply | Reply to all | Forward | Print | Add sender to contacts list | Trash this message | Report phishing | Show original On Fri, Jul 16, 2004 at 10:19:20AM -0500, Dinoj Surendran wrote: > A couple of questions on viewing OBJ files in Partiview > > How do I place a .obj object at a specified x y z location and > orientation? I'm not sure what the reference point of such an object > is... The reference point would be the coordinate origin. So the only current way to position it would be to put it in its own group and specify a "tfm" for the group -- or, of course, to apply some transformation to the vertices. > Does Partiview permit the viewing of OBJ files with more than one > color? I think you've answered this before, sorry to ask it again. It > would be nice if you had an example already. Several answers: - "waveobj" can deal with multiple colors only via texturing. That is, you could say texture -M 1 blah.sgi waveobj -t 1 flump.obj and have flump.obj include "vt" texture coordinates. If you made a texture image with patches of solid color, and assigned texture coordinates to lie within one or another patch, you could get colored faces. But otherwise no. You can't have a .mtl material library, and assign materials to subsets of faces, as the full-fledged Wavefront .obj format would allow. - "mayaobj", which also reads .obj files, does allow assigning material properties (colors, shininess factors, textures, etc.) to groups of faces. But it was written to work with Maya, so rather than reading .mtl libraries it digs through Maya ASCII (.ma) files. I haven't tried to document the relevant pieces of those so that non-Maya users could generate them, but could if that sounds appealing. - There's currently no format which allows just assigning RGB colors to faces right in-line, in the partiview input file. Is that what you'd like? I could easily add a reader for OFF format, which looks like: OFF # nedges needn't be correct, but some number is expected vert0x vert0y vert0z vert1x vert1y vert1z ... verts-on-face0 vertindex0 vertindex1 vertindex2 ... [ facecolor0R G B ] verts-on-face1 vertindex0 vertindex1 vertindex2 ... [ facecolor1R G B ] etc. You're expected to provide colors either to all faces or to none of them. There are also provisions for per-vertex colors and/or texture coordinates, in which case the file begins with something like COFF or STOFF. The general form is mayaobj [-time | -static] [-c defaultcolorindex] [-scene scenename.ma] objmodel.obj In typical use, it assumes that the scene-file and OBJ file have the same base name (e.g. fred.obj and fred.ma), and that the time applies to the current datatime, so you can just say mayaobj fred.obj I've just checked a "mayaobj" example into CVS -- it's under the "data/maya" directory, so "cvs update -d" will make it show up. "mayaobj.cf" demonstrates it. ------------------------------------------------------------- From: Stuart Levy To: dinoj@cs.uchicago.edu Date: Wed, 25 Aug 2004 12:45:18 -0500 Q: how to compile partiview using static libraries in linux? Oh, static libraries -- if you want just particular libs to be static, and don't care about the rest, you could hand-edit the Makefile after configure-ing, and replace things like -lwhatnot with /usr/local/lib/libwhatnot.a (or whatever the library's full path is -- it'll end in libsomething.a). If you wanted to use only static libraries, you could insert the option "-static" or "-Wl,-Bstatic" preceding the list of libraries. This is liable to fail since some libs (libGL, libc, libpthread) probably exist in only dynamic versions though. Maybe the handiest way: you can bracket a list of libraries with "static" and "dynamic" options, like: ... -Wl,-Bstatic -lfltk -lGLU -lstdc++ -Wl,-Bdynamic -lGL -lX11 ... ------------------------------------------------------------- On Mon, May 31, 2004 at 10:17:17PM -0500, Dinoj Surendran wrote: > Haven't finished processing data yet to test this with, will do so tomorrow. In > the meantime, how is -subst f0 supposed to work? Can I call it in the command > window? Yes, you'd say add warp -subst 3 or something like that. For a general interface, how does this sound? I imagine that particles might have some non-dimension-worthy attributes (e.g. to determine color), so might keep "-subst" to specify the index of the first interesting one. Then you provide weights for each displayed coordinate (X,Y,Z) as comma-separated lists. So to get the effect of "-subst 2" in the original design, where field 2 -> x, 3->y, 4->z, you could use: add warp -subst 2 -wx 1,0,0 -wy 0,1,0 -wz 0,0,1 or equivalently add warp -subst 0 -wx 0,0,1,0,0 -wy 0,0,0,1,0 -wz 0,0,0,0,1 Maybe it'd also be nice to allow specifying zero-point values for the fields, and an offset for the resulting xyz position, like: add warp -subst 0 -wx .25,.25,.25,.25 -wy -.5,0,.5,0 -wz 0,1,0,0 -ref .5,.6,.7,.8 -add -1,1,-1 which would mean x = (f0 - 0.5)*.25 + (f1 - 0.6)*.25 + (f2 - 0.7)*.25 + (f3 - 0.8)*.25 - 1 y = (f0 - 0.5)*-.5 + + (f2 - 0.7)*.5 + 1 z = (f1 - 0.6) - 1 .... > This would be quite nice, yes. One thing's not clear to me though - > how would you address the first three columns of a speck file? -3, -2, > -1? Hmm, that does sound ugly, doesn't it. Should I let you call them "x", "y", "z"? That would mean that you shouldn't give those names to ordinary attributes, but maybe that's not too nasty a restriction. .... Come to think of it, I should really make the syntax for -wx -wy -wz a bit more convenient -- you should be able to say ... datavar alpha 3 datavar beta 4 datavar gamma 5 ... warp -wx alpha:1 gamma:0.5 -wy beta:1 alpha:-1 -wz gamma:1 i.e. using named fields, and listing coefficients in whatever order made sense to the user, rather than forcing you to write something like warp -wx 3:1,0,0.5 -wy 3:-1,0,1 -wz 5:1 From: Stuart Levy To: dinoj@cs.uchicago.edu Date: Fri, 23 Jul 2004 01:11:17 -0500 (CDT) Subject: N-to-3D projection with warp I think the CVS partiview might do this correctly now. There's a small "warpproj.cf" example file in the data/ directory too. It works in the way I'd proposed in the last message, where you can write things like: datavar ... alpha datavar ... beta datavar ... gamma warp -wx alpha:1 beta:-1 -wy beta:1 -wz gamma:-0.5 -ref beta:0.5 gamma:-0.5 -add 1,1,1 And it should work (though I haven't tested this) to use the special names "x", "y", "z" to refer to the pre-projection space coordinates. I didn't let you write -3/-2/-1 since those wouldn't be the right numbers anyway for directly indexing the array. They'd need to be something like -5/-4/-3. > I've compiled it now on a Linux box, and tested out the example in > warpproj.cf . Thanks - I've got the hang of the -warp command as > placed in a .cf file now. Good! > Problem: how do I use the warp command from the command window? I'd > like to be able to type, say, "warp -wx x:1 -wx y:1 -wx z:2, a:2" in > it. This may be in an old email of yours from way back before my > Great Email Crash. OK, yes, in the text box you can precede these data-command things with "add", as in add warp -wx x:1 -wx y:1 -wx z:2, a:2 (well you'd probably really want something slightly different, like add warp -wx x:1 -wy y:1 -wz z:2, a:2 ) ... From: Stuart Levy To: dinoj@cs.uchicago.edu Date: Mon, 26 Jul 2004 09:24:02 -0500 OK, I think it's all fixed now. Changes to warp.c and partibrains.c in CVS. And you can "warp" (no preceding "add") to show current settings. From: Stuart Levy To: dinoj@cs.uchicago.edu Date: Mon, 26 Jul 2004 12:43:27 -0500 Oh, I see another problem too. I didn't expect you to assume that the x y z coordinates immediately precede the data attributes -- they're not stored that way. But I've just checked in a change that should make warp -wx x:1,0,0,0.1 work the way you'd expect. ... Also, I hadn't intended you to use double-colons, but didn't detect them as an error, and due to another piece of fluff, they ended up being detected as (I think) the last named datavar. It accepts double-colons silently now, and rejects zero-length names in other contexts. ------------------------------------------------------------- Note that you could hand-check individual points by middle-clicking on them (or putting the mouse cursor over a point and typing the "p" key). It'll print the transformed 3-D coordinates and the values of all the named attributes. ------------------------------------------------------------- From: Stuart Levy To: dinoj@cs.uchicago.edu Cc: Stuart Levy Date: Wed, 28 Jul 2004 00:09:20 -0500 > Different question: Is there a way for you to associate labels (and > later on, mesh points) with data points rather than specific locations > in 3d space? That would be nice, wouldn't it... And I guess likewise for graph edges, once there's a good way to draw graphs: you'd want the edges to follow the transformed points. What would be the right way to express this? Could it work rather like the OFF or .obj formats, where there's a table of points+attributes (as there is now) plus a table of text strings / line segments /etc that, rather than being given 3-D coordinates directly, instead are labelled with table indices? There'd need to be some sensible way to group the points, I guess; something like { # group of points, first of which has index of 0 x0 y0 z0 blah0 ... # freddie x1 y1 z1 blah1 ... 0 text -size 1.5 fred line -w 2 0 2 3 0 # "line", optional -w linewidth, followed by a list of vertex indices line -w 3 1 3 4 .... } { # another group of points, with indices again starting with 0 x0 y0 z0 blah0 ... x1 y1 z1 blah1 ... .... } ? Maybe it could work so that X Y Z text ... acts as it does now, while "text" preceded by a single integer would refer to a numbered vertex. --------- chromadepth : see hipchroma file in data directory of partiview cvs entry --------