多边形glPolygonMode glFrontFace glCullFace glPolygonStipple

 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); //GL_LINE 对 glPolygonStipple 不起作用
   glFrontFace(GL_CW);// clock wise
   glCullFace(GL_FRONT_AND_BACK);// back face
   glEnable(GL_POLYGON_STIPPLE); // GL_POLYGON_SMOOTH 对 glPolygonStipple 不起作用
   glPolygonStipple (fly);
多边形的抗锯齿,建议用多重纹理采样,相比用平滑顶点形状大小和插值,可以更快更高效些。

使用显示列表,可以使点画模式绘制多边形效率最大化。

绘制凹多边形需要拆分为三角形来绘制,三角形不能用绘制多边形的共享边剔除,因此需要glEdgeFlay(GL_FALSE)来指定顶点; // GL_TRUE来指定后面的顶点是否为边界点,GL_FALSE是共享点。
/*
 * Copyright (c) 1993-2003, Silicon Graphics, Inc.
 * All Rights Reserved
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose and without fee is hereby granted, provided that the above
 * copyright notice appear in all copies and that both the copyright
 * notice and this permission notice appear in supporting documentation,
 * and that the name of Silicon Graphics, Inc. not be used in
 * advertising or publicity pertaining to distribution of the software
 * without specific, written prior permission.
 *
 * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND
 * WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
 * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
 * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, </
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值