| Re: XObjView: Select Object and Opacity Problem [message #41690 is a reply to message #41600] |
Tue, 09 November 2004 10:53   |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
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
|
|
|
|