Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
XObjView: Select Object and Opacity Problem
Hello, I want to select an object in XObjView and rotate it, but other objects should be fixed. I read in the refguide, that it is possible to add Arrays to XObjView. So I think it should work, but how? Is there a posibility to realize this idea? My first try was with the SELECT_TARGET property but it seems to me that nothing changed in View. An other way I thought about is to create to Models theModel_1 = Obj_New('IDLgrModel') and theModel_2 = Obj_New('IDLgrModel') give them rotate,scale and Translate Options, because I think every Model would need its own zeropint. But when I zoom, in XObjView it always depends on one Point. Any ideas? My second problem deals with the alphachannel. It works, and I can change the opacity. the front view in XObjView (x-y level) is good, but when i rotate my data and have a look at y-z level i have stripes. Could this depend on the alphachannel? Or maybe the slices, because i scaled the stac? Thanks for any help and ideas. Regards Robert
Re: XObjView: Select Object and Opacity Problem
Robert Schaefer writes: > I want to select an object in XObjView and rotate it, > but other objects should be fixed. > I read in the refguide, that it is possible > to add Arrays to XObjView. So I think it should work, > but how? Well, here is an example of how you can get this to work, sorta: ;******************************************************** PRO Example ; Create contour object: oCont = OBJ_NEW('IDLgrContour', DIST(20), N_LEVELS=10) ; Create surface object: oSurf = OBJ_NEW('IDLgrSurface', $ DIST(20),INDGEN(20)+20, INDGEN(20)+20) ; View model: XOBJVIEW, [osurf], Stationary=[ocont] end ;******************************************************** I think you are probably going to have to eventually give up on XObjView though. You are pushing it now almost beyond the breaking point of where it was meant to go. :-) > > An other way I thought about is to create to Models > theModel_1 = Obj_New('IDLgrModel') and theModel_2 = Obj_New('IDLgrModel') > give them rotate,scale and Translate Options, because I think > every Model would need its own zeropint. But when I zoom, in > XObjView it always depends on one Point. I think this is a result of what XObjView was designed to do originally. As I say, I think you are pushing it well beyond this point. > My second problem deals with the alphachannel. > It works, and I can change the opacity. the front > view in XObjView (x-y level) is good, but when > i rotate my data and have a look at y-z level i have > stripes. Could this depend on the alphachannel? > Or maybe the slices, because i scaled the stac? It could depend on a lot of things. One of the problems with object graphics, of course, is that *everything* is possible. It makes the Universe of potential problems rather large as well. :-( A better description of the code might help. And, of course, it always pays to read about the "pimento problem" in the IDL newsgroup archives. :-) Cheers, David -- David W. Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http:/www.dfanning.com/ Phone: 970-221-0438, IDL Book Orders: 1-888-461-0155
Robert Schaefer wrote: > I want to select an object in XObjView and rotate it, > but other objects should be fixed. Aside from David's suggestion, I think that you have moved beyond the realm of XOBJVIEW. XOBJVIEW throws everything in a top level model, gets the extents of that model, sets the viewing parameters and draws the scene. There is no way to select and manipulate individual objects/models. You'll have to build your own viewing system. You may want to look at my camera object and some of the demos. I don't have anything that demonstrates picking objects, but maybe you'll get some ideas/inspiration from them. http://www.acoustics.washington.edu/~towler/ The CSS is broken in Firefox and has been for months but you still should be able to navigate and d/l files. I apologize. It will be fixed some day... > My second problem deals with the alphachannel. > It works, and I can change the opacity. the front > view in XObjView (x-y level) is good, but when > i rotate my data and have a look at y-z level i have > stripes. Could this depend on the alphachannel? > Or maybe the slices, because i scaled the stac? This is a problem with rendering order. A weak explanation follows: Assume you have 2 planes orthogonal to the vector [0,0,1]. A semi-transparent one containing the point [0,0,0.5] and the other opaque containing the point [0,0,-0.5]. Also remember that your viewing vector is *always* fixed at [0,0,-1]. When you rotate these two objects 90 deg. it gets difficult to separate the objects properly in terms of rendering order. At 85 deg. the front, semi-transparent object, is still in front of the back object in regards to Z. But at 95 the "front" object's vertices are now more negative in terms of Z than the back object. In between you have a mix, some of the verts of the front object are +z some are -z. It is in this case where you see the banding as IDL renders some of the triangles for the back plane *after* rendering some of the triangles of the front plane. You can verify that this is your issue by continuing to rotate the objects. If, as you rotate, the banding fills in and you lose part or all of your semi-transparent object then you are in fact seeing this. For the gory details of rendering order and semi-transparent objects, google the group for "Pimento Problems". In short, there aren't any easy clean fixes. If you are using the alpha channel you have to manually sort all of your objects in regards to Z. With simple scenes this isn't that difficult. With complicated scenes/geometry it is very difficult. If the banding only occurs where your objects are very close to each other then it is probably a traditional z-buffer precision issue. In this case you'll need to adjust the eye property of your view, moving it further away from the near clipping plane to increase z-buffer precision at distance. But I doubt you would have this problem with XOBJVIEW. -Rick