Line 8... |
Line 8... |
// Abstract:
|
// Abstract:
|
// Construct triangle from vertices.
|
// Construct triangle from vertices.
|
// divide by 2 x, y after integer convesion
|
// divide by 2 x, y after integer convesion
|
//
|
//
|
// Author:
|
// Author:
|
// Kenji Ishimaru (kenji.ishimaru@prtissimo.com)
|
// Kenji Ishimaru (info.wf3d@gmail.com)
|
//
|
//
|
//======================================================================
|
//======================================================================
|
//
|
//
|
// Copyright (c) 2015, Kenji Ishimaru
|
// Copyright (c) 2015, Kenji Ishimaru
|
// All rights reserved.
|
// All rights reserved.
|
Line 37... |
Line 37... |
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
//
|
//
|
// Revision History
|
// Revision History
|
|
// Bugfix
|
|
// w_all_inside,w_all_outside needs bit reduction
|
|
// w_all_inside,w_all_outside needs bit reduction
|
|
|
`include "fm_3d_define.v"
|
`include "fm_3d_define.v"
|
module fm_geo_tri (
|
module fm_geo_tri (
|
input clk_core,
|
input clk_core,
|
input rst_x,
|
input rst_x,
|
Line 130... |
Line 133... |
// o_outcode[1] : +X plane
|
// o_outcode[1] : +X plane
|
// o_outcode[2] : -Y plane
|
// o_outcode[2] : -Y plane
|
// o_outcode[3] : +Y plane
|
// o_outcode[3] : +Y plane
|
// o_outcode[4] : -Z plane
|
// o_outcode[4] : -Z plane
|
// o_outcode[5] : +Z plane
|
// o_outcode[5] : +Z plane
|
|
assign w_all_inside = ~(|(r_v0_outcode | r_v1_outcode | r_v2_outcode));
|
assign w_all_inside = ~(r_v0_outcode | r_v1_outcode | r_v2_outcode);
|
assign w_all_outside = |(r_v0_outcode & r_v1_outcode & r_v2_outcode);
|
assign w_all_outside = (r_v0_outcode & r_v1_outcode & r_v2_outcode);
|
//assign w_all_inside = ~(r_v0_outcode | r_v1_outcode | r_v2_outcode);
|
|
//assign w_all_outside = (r_v0_outcode & r_v1_outcode & r_v2_outcode);
|
assign w_z_outside = (|r_v0_outcode[5:4]) |
|
assign w_z_outside = (|r_v0_outcode[5:4]) |
|
(|r_v1_outcode[5:4]) |
|
(|r_v1_outcode[5:4]) |
|
(|r_v2_outcode[5:4]);
|
(|r_v2_outcode[5:4]);
|
assign w_tri_outside = w_all_outside | w_z_outside;
|
assign w_tri_outside = w_all_outside | w_z_outside;
|
|
|