OK, for posterity's sake, I wanted to close out this thread with some information in case others need the same help.
I made the changed described in 1-5. Namely, I moved the camera so no segment associated with my grids or the objects I am plotting can get behind or even very near the camera. I still move the camera's location for panning, but that is carefully controlled so it doesn't get any closer to the object. Since this is a CAD-type program, I have views corresponding to "Top", "Front", "Right", and a "Perspective" view where the camera is suspended to the left and above the object. The "Top", "Front", and "Right" views all have the camera looking straight down on the object and it pans in a plane that stays parallel to the construction plane the objects are on. For perspective, the camera is attached to a sphere whose radius is fixed so it stays equidistant from the objects (more or less). The origin of the sphere is the center of the object's extents. To implement the spherical camera movement was pretty easy. I just convert the X, Y, Z (Cartesian) camera coordinates to spherical coordinates, and tie the mouse's panning and tilting to the azimuth and elevation. Since the radius is fixed, I apply the mouse move and then convert back to Cartesian to position the camera. All of this cleared up pretty much all the display artifacts I was seeing. The conclusion seems to be that segments are unhappy if a vertex gets behind the camera. So, like the joke goes, when you tell the doctor it hurts when you do that, "Don't do that." Cheers, BW On May 27, 6:33 pm, BobWarfield <[email protected]> wrote: > Ok, no thoughts on the sample code. > > Let me try another tack. I read of problems with segments not > clipping properly. This makes me wonder about how I am managing the > camera for this application. > > Today, all the navigation happens by moving the camera through space-- > I am not changing its zoom or focus from the defaults at all. > > Perhaps my problems are all due to these segments getting behind the > camera??? > > So, do you think things will work better if I change my camera to work > thusly: > > 1. It will always be positioned such that it is far enough away that > none of the segments from the grid or wireframe objects can ever get > behind it. > > 2. I need to zoom extents on these objects, which I will do by > pointing the camera at the center of the objects extents and then > selecting an appropriate zoom value. The camera will not move (today > it is moving). > > 3. The mouse wheel is used to zoom towards the object and instead of > moving the camera, it will simply change the camera's zoom. > > 4. In views aligned with the axes, I allow panning with the mouse > that simply moves the camera parallel to the axes that are planar to > the screen. But there will be no ability to move the camera closer or > further. It can only be zoomed by mouse wheel per #3. > > 5. In the perspective view, the camera can be tilted. This was > accomplished by moving the camera. The camera will still be allowed > to move, but it will be fixed to the surface of a sphere whose radius > and origin are such that the camera never gets closer to the center > point it is looking at, and so no object can get behind it. > > Do the Away3D Jedi Masters think this will fix my problems? Is it > worth undertaking this rewrite of my camera code? > > What say you? I'd like to get this ironed out. > > Best, > > BW > > On May 22, 6:32 pm, Bob Warfield <[email protected]> wrote: > > > > > Any thoughts on the sample? > > > Best, > > >BW > > > On Thu, May 20, 2010 at 10:19 AM, Bob Warfield <[email protected]> > > wrote: > > > Okay, I've zipped some source code that reproduces the problem. Download: > > > >http://www.cnccookbook.com/img/GWizardE/GridIssues/LeGrid.zip > > > > I'm using Away3D 2.4. The source files go in a Flex project called > > > "LeGrid". > > > > If you bring it up, there is nothing. Press the Zoom! button to see the > > > grid painted correctly. Now click the Bug! button to see the problem. > > > The > > > Bug! button is simply dropping us down in Z closer to the origin, but it > > > doesn't take long (1 click on my machine with the window zoomed) to see > > > the > > > issue. > > > > Hope this helps! > > > > Best, > > > >BW > > > > On Wed, May 19, 2010 at 7:47 PM, Bob Warfield > > > <[email protected]>wrote: > > > >> I'll see what I can do. It'll take some doing to refactor things apart > > >> to > > >> get something minimal that just draws the grid in the same situation. > > > >> Best, > > > >>BW > > > >> On Wed, May 19, 2010 at 4:04 PM, Rob Bateman > > >> <[email protected]>wrote: > > > >>> Hey Bob > > > >>> hmm, another problem reporting segments disappearing... > > > >>> not sure whats going on here, but would it be possible to provide a test > > >>> class? something simple that exhibits the bug so that we can try and > > >>> debug > > >>> the problem? > > > >>> cheers > > > >>> Rob > > > >>> On Wed, May 19, 2010 at 12:20 AM, BobWarfield > > >>> <[email protected]>wrote: > > > >>>> I've got a CAD/CAM application I'm playing with and having some > > >>>> problems with display artifacts. All objects are Segments that are > > >>>> added to a couple of Meshes. One Mesh is a background grid, and the > > >>>> other is the CAD object. > > > >>>> Here is a view from the top of a typical CAD drawing: > > > >>>>http://www.cnccookbook.com/img/GWizardE/GridIssues/Top.jpg > > > >>>> It's very well behaved. > > > >>>> Now I move the camera to present a perspective view. The only change > > >>>> between the two is that the camera has moved to a new location: > > > >>>>http://www.cnccookbook.com/img/GWizardE/GridIssues/Persp1.jpg > > > >>>> Note how some grid segments are missing altogether in the foreground, > > >>>> and others are looking odd. If I move the camera closer, it gets > > >>>> worse: > > > >>>>http://www.cnccookbook.com/img/GWizardE/GridIssues/Persp2.jpg > > > >>>> If I move the camera just a little further away, it looks fine: > > > >>>>http://www.cnccookbook.com/img/GWizardE/GridIssues/Persp4.jpg > > > >>>> How can I fix this? > > > >>>> Thanks, > > > >>>> Bob W. > > > >>> -- > > >>> Rob Bateman > > >>> Flash Development & Consultancy > > > >>> [email protected] > > >>>www.infiniteturtles.co.uk > > >>>www.away3d.com-Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text -
