Nullref crash when calling RenderScene
#1
Code:
My callstack looks like this:


  at Ab3d.DirectX.RenderablePrimitive.RenderGeometry(RenderingContext renderingContext)
  at Ab3d.DirectX.RenderObjectsRenderingStep.(RenderingContext , RenderingQueue , ICamera , List`1 , Effect )
  at Ab3d.DirectX.RenderObjectsRenderingStep.(RenderingContext , Int32 , IMultiPassEffect , ReadOnlyCollection`1 , ICamera , List`1 , Effect , Boolean , Boolean )
  at Ab3d.DirectX.RenderObjectsRenderingStep.OnRun(RenderingContext renderingContext)
  at Ab3d.DirectX.RenderingStepBase.Run(RenderingContext renderingContext)
  at Ab3d.DirectX.DXScene.(RenderingContext )
  at Ab3d.DirectX.DXScene.(RenderingContext , Boolean )
  at Ab3d.DirectX.DXScene.RenderScene(Boolean forceRenderAll)
  at app.application.ui_3d.DxRenderPanel.Render() in C:\code\particulate\application\ui_3d\DxRenderPanel.cs:line 170
  at app.application.DxSceneview._updateCameraMatrices() in C:\code\particulate\application\Sceneview\DxSceneview.cs:line 161
  at app.application.DxSceneview._updateCameraMatrices(Object sender, EventArgs e) in C:\code\particulate\application\Sceneview\DxSceneview.cs:line 165
  at System.EventHandler.Invoke(Object sender, EventArgs e)
  at app.application.Cameras.CameraBase.OnTransformModified() in C:\code\particulate\application\Cameras\CameraBase.cs:line 33
  at app.application.Cameras.CameraBase.set_Transform(Matrix4 value) in C:\code\particulate\application\Cameras\CameraBase.cs:line 48
  at app.application.Cameras.CameraBase.set_Position(Vector3 value) in C:\code\particulate\application\Cameras\CameraBase.cs:line 57
  at app.application.Cameras.CameraBase.PlacePerspCameraToBoundingBag(BoundingBag3 bag, IPerspCamera camera) in C:\code\particulate\application\Cameras\CameraBase.cs:line 237
  at app.application.Cameras.DxCamera.PlaceCameraToBoundingBag(BoundingBag3 bag) in C:\code\particulate\application\Cameras\DxCamera.cs:line 125
  at app.application.DxSceneview.AutoPlaceCamera(IEnumerable`1 nodes) in C:\code\particulate\application\Sceneview\DxSceneview.cs:line 199
  at app.app._paradigm_InitiallyShown(Object sender, EventArgs e) in C:\code\particulate\Program.cs:line 1222
  at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
  at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
  at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
  at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
  at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
  at DevExpress.XtraEditors.XtraForm.SetVisibleCore(Boolean value)
  at DevExpress.XtraBars.Ribbon.RibbonForm.SetVisibleCore(Boolean value)
  at System.Windows.Forms.Control.set_Visible(Boolean value)
  at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
  at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
  at System.Windows.Forms.Application.Run(Form mainForm)
  at app.EntryPoint.Main() in C:\code\particulate\EntryPoint.cs:line 63

I'm quite certain this is crashing because of a MeshObjectNode, but the thing is, I don't know *why* it is crashing. The mesh object node is setup with code that looks something like this:

Code:
_sceneNode = new MeshObjectNode(
   _mesh = new GeometryMesh(),
   _material = new StandardMaterial { DiffuseColor = Colour.White.ToColor3() });

_sceneNode.Tag = this;
_mesh.Materials = _sceneNode.Materials;

_dxScene.RootNode.AddChild(_sceneNode);

var points = dataSource.Points.Value;
var indices = dataSource.Indices.Value;

_mesh.Positions = points
   .Select(Ab3dExtensions.Ab3dExtensions.ToDxVector3)
   .ToArray();
_mesh.Normals = PolyShapeHelpers.ComputeNormals(points, indices)
   .Select(Ab3dExtensions.Ab3dExtensions.ToDxVector3)
   .ToArray();
_mesh.TriangleIndices = indices;

if (_sceneNode.ParentDXScene != null)
{
   _mesh.RecreateMesh();
   _sceneNode.UpdateBounds(false);
}

So I'm not sure what is "null" that is causing the dxscene to crash when rendering. How can I figure out what is causing the crash? Thanks!
  


Messages In This Thread
Nullref crash when calling RenderScene - by Hamish - 03-05-2018, 06:47 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)