Screen to volume transform?
#5
I'm still not "getting" what you're trying to explain.

I have a Viewport3D. It has a certain physical size on the screen - X pixels by Y pixels. The Viewport3D has an orthographic camera with a position, an up direction a look direction etc. Here's the XAML describing my Viewport3D...

Code:
<dxControls:DXViewportView Name="MainViewportView" PresentationType="DirectXImage" Margin="230,70,20,170" ClipToBounds="true">
            <Viewport3D Name="MainViewport" >
                <Viewport3D.Camera>
                    <OrthographicCamera LookDirection="0,0,-1" Position="0,0,10"  UpDirection="0, 1, 0"  />
                </Viewport3D.Camera>
            </Viewport3D>
        </dxControls:DXViewportView>

Is there an implicit view volume from which I can determine the width and height for the OrthoRH Matrix in your previous answer?

And here's some sample C# to draw some lines . . .

Code:
Point3D point3Da = new Point3D(-0.99, 0.6, -5);
                Point3D point3Db = new Point3D(-0.99, -0.6, -5);
                Point3D point3Dc = new Point3D(0.99, -0.6, -5);
                Point3D point3Dd = new Point3D(0.99, 0.6, -5);
                Point3D point3De = new Point3D(0.0, 0.0, -5);
                allPositions.Add(point3Da);
                allPositions.Add(point3Db);
                allPositions.Add(point3Dc);
                allPositions.Add(point3Dd);
                allPositions.Add(point3De);

                var simplePositionCollection = new Point3DCollection(allPositions);
                int size = simplePositionCollection.Count;
                MainViewport.BeginInit();
                MainViewport.Children.Clear();
                var polyLineVisual3D = new Ab3d.Visuals.PolyLineVisual3D()
                {
                    Positions = simplePositionCollection,
                    LineColor = Colors.DarkOrange,
                    LineThickness = 3,   // was 1 -  made it 3 so see better on screen shots
                    Transform = new TranslateTransform3D(0, 0, 0)  
                };
                MainViewport.Children.Add(polyLineVisual3D);
                MainViewport.EndInit();

... now these particular lines just outline the Viewport3D (see the attachment). So what I want to know is, for a given Point3D in the coordinate system of the polyLineVisual3D's in the code, where will that appear in pixel-space in the Viewport3D? Thanks in advance.
   
  


Messages In This Thread
Screen to volume transform? - by pnelsonAG - 01-20-2017, 12:26 AM
RE: Screen to volume transform? - by abenedik - 01-23-2017, 09:45 PM
RE: Screen to volume transform? - by pnelsonAG - 01-27-2017, 10:32 PM
RE: Screen to volume transform? - by abenedik - 01-27-2017, 11:02 PM
RE: Screen to volume transform? - by pnelsonAG - 02-14-2017, 02:18 AM
RE: Screen to volume transform? - by abenedik - 02-14-2017, 10:54 AM
RE: Screen to volume transform? - by pnelsonAG - 02-14-2017, 07:05 PM
RE: Screen to volume transform? - by abenedik - 02-15-2017, 10:05 AM

Forum Jump:


Users browsing this thread:
2 Guest(s)