C++ (MFC)下 OPENGL 画 矩形网格

libingbing5210 2013-08-14 11:51:01
在C++(MFC)下 怎么画 矩形的网格,还有就是每个小格子的距离是怎么去定义的!(即平时我们一个像素为单位1,这里是怎么去定义 一小格的大小的呢???)

说的简单点,就是我想画个 8*8的矩形网格,完成后 我再将每个小格子 也划分成 3*3 的小格子!!!


求大神解答下!!!有类似的源码 最佳!!!急求!!!
...全文
350 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
向立天 2013-09-18
  • 打赏
  • 举报
回复
您好 我是本版版主 此帖已多日无人关注 请您及时结帖 如您认为问题没有解决可按无满意结帖处理 另外本版设置了疑难问题汇总帖 并已在版面置顶 相关规定其帖子中有说明 您可以根据规定提交您帖子的链接 如您目前不想结帖只需回帖说明 我们会删除此结帖通知 见此回复三日内无回应 我们将强制结帖 相关规定详见界面界面版关于版主结帖工作的具体办法
赵4老师 2013-08-14
  • 打赏
  • 举报
回复
没看出和OpenGL有什么关系。 CDC::FrameRect void FrameRect( LPCRECT lpRect, CBrush* pBrush ); Parameters lpRect Points to a RECT structure or CRect object that contains the logical coordinates of the upper-left and lower-right corners of the rectangle. You can also pass a CRect object for this parameter. pBrush Identifies the brush to be used for framing the rectangle. Remarks Draws a border around the rectangle specified by lpRect. The function uses the given brush to draw the border. The width and height of the border is always 1 logical unit. If the rectangle’s bottom coordinate is less than or equal to top, or if right is less than or equal to left, the rectangle is not drawn. The border drawn by FrameRect is in the same position as a border drawn by the Rectangle member function using the same coordinates (if Rectangle uses a pen that is 1 logical unit wide). The interior of the rectangle is not filled by FrameRect. CDC Overview | Class Members | Hierarchy Chart See Also CBrush,::FrameRect, CDC::Rectangle, CDC::FrameRgn, RECT
赵4老师 2013-08-14
  • 打赏
  • 举报
回复
搜网络教程“学OpenGL编3D游戏”。
赵4老师 2013-08-14
  • 打赏
  • 举报
回复
上帖错引了OpenCV的画矩形函数了,帖主可以无视。
赵4老师 2013-08-14
  • 打赏
  • 举报
回复
Rectangle 绘制简单、指定粗细或者带填充的 矩形 void cvRectangle( CvArr* img, CvPoint pt1, CvPoint pt2, CvScalar color, int thickness=1, int line_type=8, int shift=0 ); img 图像. pt1 矩形的一个顶点。 pt2 矩形对角线上的另一个顶点 color 线条颜色 (RGB) 或亮度(灰度图像 )(grayscale image)。 thickness 组成矩形的线条的粗细程度。取负值时(如 CV_FILLED)函数绘制填充了色彩的矩形。 line_type 线条的类型。见cvLine的描述 shift 坐标点的小数点位数。   函数 cvRectangle 通过对角线上的两个顶点绘制矩形。
libingbing5210 2013-08-14
  • 打赏
  • 举报
回复
引用 1 楼 zhao4zhong1 的回复:
没看出和OpenGL有什么关系。 CDC::FrameRect void FrameRect( LPCRECT lpRect, CBrush* pBrush ); Parameters lpRect Points to a RECT structure or CRect object that contains the logical coordinates of the upper-left and lower-right corners of the rectangle. You can also pass a CRect object for this parameter. pBrush Identifies the brush to be used for framing the rectangle. Remarks Draws a border around the rectangle specified by lpRect. The function uses the given brush to draw the border. The width and height of the border is always 1 logical unit. If the rectangle’s bottom coordinate is less than or equal to top, or if right is less than or equal to left, the rectangle is not drawn. The border drawn by FrameRect is in the same position as a border drawn by the Rectangle member function using the same coordinates (if Rectangle uses a pen that is 1 logical unit wide). The interior of the rectangle is not filled by FrameRect. CDC Overview | Class Members | Hierarchy Chart See Also CBrush,::FrameRect, CDC::Rectangle, CDC::FrameRgn, RECT
不是说 有没有关系的问题!!就是想用OPENGL画 矩形网格!!!想知道具体怎么实现的....

15,978

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧