private void integerTrackbarControlNeighborsCount_ValueChanged( IntegerTrackbarControl _Sender, int _FormerValue ) { int NeighborsCount = integerTrackbarControlNeighborsCount.Value; if ( m_SB_Neighbors != null ) m_SB_Neighbors.Dispose(); m_SB_Neighbors = new StructuredBuffer< SB_Neighbor >( m_Device, NeighborsCount, true ); WMath.Vector[] Directions = null; if ( radioButtonHammersley.Checked ) { double[,] Samples = m_Hammersley.BuildSequence( NeighborsCount, 2 ); Directions = m_Hammersley.MapSequenceToSphere( Samples ); } else { Random TempRNG = new Random(); Directions = new WMath.Vector[NeighborsCount]; for ( int i=0; i < NeighborsCount; i++ ) { Directions[i] = new WMath.Vector( 2.0f * (float) TempRNG.NextDouble() - 1.0f, 2.0f * (float) TempRNG.NextDouble() - 1.0f, 2.0f * (float) TempRNG.NextDouble() - 1.0f ); Directions[i].Normalize(); } } Random RNG = new Random( 1 ); m_NeighborPositions = new float3[NeighborsCount]; m_NeighborColors = new float3[NeighborsCount]; for ( int NeighborIndex=0; NeighborIndex < NeighborsCount; NeighborIndex++ ) { float Radius = 2.0f; // Make that random! m_NeighborPositions[NeighborIndex] = Radius * new float3( Directions[NeighborIndex].x, Directions[NeighborIndex].y, Directions[NeighborIndex].z ); float R = (float) RNG.NextDouble(); float G = (float) RNG.NextDouble(); float B = (float) RNG.NextDouble(); m_NeighborColors[NeighborIndex] = new float3( R, G, B ); m_SB_Neighbors.m[NeighborIndex].m_Position = m_NeighborPositions[NeighborIndex]; m_SB_Neighbors.m[NeighborIndex].m_Color = m_NeighborColors[NeighborIndex]; } m_SB_Neighbors.Write(); // Upload }
private void integerTrackbarControlVertex_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue) { UpdateVertexInfos(); }
private void integerTrackbarControlSHCoeffsCount_ValueChanged( IntegerTrackbarControl _Sender, int _FormerValue ) { integerTrackbarControlm.RangeMin = -integerTrackbarControlSHCoeffsCount.Value; integerTrackbarControlm.RangeMax = integerTrackbarControlSHCoeffsCount.Value; integerTrackbarControlm.VisibleRangeMin = -integerTrackbarControlSHCoeffsCount.Value; integerTrackbarControlm.VisibleRangeMax = integerTrackbarControlSHCoeffsCount.Value; }
private void integerTrackbarControlPlane_ValueChanged(IntegerTrackbarControl _Sender, int _FormerValue) { UpdatePlaneInfos(); }