91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.3MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-27
  • 語言: 其他
  • 標簽: OBJ模型??

資源簡介

OBJ模型的加載繪制放大縮小移動

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.Text;
using?System.Windows.Forms;
using?System.Drawing;
using?CsGL.OpenGL;
using?CsGL.Util;

namespace?OpenGL_1
{
????public?class?csglViewer?:?OpenGLControl
????{
????????drawMan?man?=?new?drawMan();
????????drawLegs?Legs?=?new?drawLegs();

????????private?loadObjFile?lOF?=?new?loadObjFile();?//保存繪圖數據

????????//定義交互性變量,用于視口的鼠標控制
????????public?float?m_xTranslation=0.0f?m_yTranslation=-0.0f?m_zTranslation=-0.0f;?????//
????????public?float?m_xRotation=0.0f?m_yRotation=0.0f?m_zRotation=0.0f;??????????????//定義旋轉量
????????public?float?m_xScaling=1.0f?m_yScaling=1.0f?m_zScaling=1.0f;?????????????????//定義放縮量
????????public?float?m_speedTranslation=1.0f/30.0f;????????????????????????????????//定義移動速度
????????public?float?m_speedRotation?=?0.1f;

????????private?uint?drawMethod=GL.GL_LINE;??????????????//定義繪圖方式

????????private?bool?lightUse=false;????????????????????????????//定義是否使用光照
????????//定義鼠標動作記錄
????????bool?lMouseButtonDown;
????????bool?rMouseButtonDown;
????????Point?lButtonDownPos;
????????Point?rButtonDownPos;
????????


????????public?csglViewer()//:?base()
????????{
????????????System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls?=?false;
????????????this.KeyDown?+=?new?KeyEventHandler(OurView_onkeydown);
????????????this.MouseDown?+=?new?MouseEventHandler(OurView_onmousedown);//鼠標按下響應事件
????????????this.MouseUp+=new?MouseEventHandler(OurView_onmouseup);//鼠標抬起響應事件
????????????this.MouseMove+=new?MouseEventHandler(OurView_onmousemove);//鼠標移動響應事件
????????????this.MouseWheel+=new?MouseEventHandler(OurView_onmousewheel);//鼠標滾輪事件

????????}

????????public?void?setObjFile(loadObjFile?l)??//將從主窗口處獲取的數據保存,用于繪圖
????????{
????????????lOF?=?l;
????????????Invalidate();
????????????Update();
????????}

????????public?void?fitParameter()????????????????//配置繪圖參數,適合模型在窗口中顯示
????????{
????????????m_xTranslation?=?-(lOF.xMaxAxes?+?lOF.xMinAxes)?/?2;
????????????m_yTranslation?=?-(lOF.yMaxAxes?+?lOF.yMinAxes)?/?2;
????????????float?maxDis;
????????????maxDis?=?lOF.xMinAxes?-?lOF.xMaxAxes;
????????????maxDis?=?(maxDis?>?(lOF.yMinAxes?-?lOF.yMaxAxes))???(lOF.yMinAxes?-?lOF.yMaxAxes)?:?maxDis;
????????????maxDis?=?(maxDis?>?(lOF.zMinAxes?-?lOF.zMaxAxes))???(lOF.zMinAxes?-?lOF.zMaxAxes)?:?maxDis;
????????????m_zTranslation?=?maxDis;
????????}

????????public?override?void?glDraw()?????//重載繪圖
????????{
????????????GL.glClear(GL.GL_COLOR_BUFFER_BIT?|?GL.GL_DEPTH_BUFFER_BIT);?//?Clear?The?Screen?And?The?Depth?Buffer?
????????????GL.glLoadIdentity();?//?Reset?The?Current?Modelview?Matrix?
????????????//?TODO:?Draw?a?box?or?something
????????????//?this.SwapBuffer();?//?swap?Buffers

????????????GL.glTranslatef(m_xTranslation?m_yTranslation?m_zTranslation);
????????????GL.glRotatef(m_xRotation?1.0f?0.0f?0.0f);
????????????GL.glRotatef(m_yRotation?0.0f?1.0f?0.0f);

????????????GL.glScaled(m_xScaling?m_yScali

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件??????66249??2009-03-21?12:56??obj\2.obj

?????文件?????295831??2009-03-22?16:00??obj\3.obj

?????文件????6790175??2009-03-22?21:28??obj\4.obj

?????文件????6746473??2009-03-23?12:16??obj\5.obj

?????文件?????452176??2009-03-23?13:46??obj\6.obj

?????文件?????430624??2009-03-23?14:16??obj\7.obj

????..A..H.?????84480??2016-05-26?10:13??obj\OpenGL_1\.vs\OpenGL_1\v14\.suo

????..A..H.?????37888??2016-05-17?18:01??obj\OpenGL_1\Backup\.vs\OpenGL_1\v14\.suo

?????文件???????8947??2009-03-24?14:53??obj\OpenGL_1\Backup\Backup\OpenGL_1\csglViewer.cs

?????文件???????1315??2009-03-24?14:03??obj\OpenGL_1\Backup\Backup\OpenGL_1\drawLegs.cs

?????文件???????5004??2009-03-19?13:22??obj\OpenGL_1\Backup\Backup\OpenGL_1\drawMan.cs

?????文件???????3321??2009-03-24?20:54??obj\OpenGL_1\Backup\Backup\OpenGL_1\Form1.cs

?????文件???????6538??2009-03-24?20:48??obj\OpenGL_1\Backup\Backup\OpenGL_1\Form1.Designer.cs

?????文件???????6017??2009-03-24?14:54??obj\OpenGL_1\Backup\Backup\OpenGL_1\Form1.resx

?????文件???????4168??2009-03-24?14:25??obj\OpenGL_1\Backup\Backup\OpenGL_1\loadObjFile.cs

?????文件???????3604??2009-03-21?11:46??obj\OpenGL_1\Backup\Backup\OpenGL_1\OpenGL_1.csproj

?????文件????????471??2009-03-18?21:07??obj\OpenGL_1\Backup\Backup\OpenGL_1\Program.cs

?????文件???????1170??2009-03-18?20:13??obj\OpenGL_1\Backup\Backup\OpenGL_1\Properties\AssemblyInfo.cs

?????文件???????2872??2009-03-18?20:13??obj\OpenGL_1\Backup\Backup\OpenGL_1\Properties\Resources.Designer.cs

?????文件???????5612??2009-03-18?20:13??obj\OpenGL_1\Backup\Backup\OpenGL_1\Properties\Resources.resx

?????文件???????1093??2009-03-18?20:13??obj\OpenGL_1\Backup\Backup\OpenGL_1\Properties\Settings.Designer.cs

?????文件????????249??2009-03-18?20:13??obj\OpenGL_1\Backup\Backup\OpenGL_1\Properties\Settings.settings

?????文件????????913??2009-03-18?20:13??obj\OpenGL_1\Backup\Backup\OpenGL_1.sln

?????文件???????8947??2009-03-24?14:53??obj\OpenGL_1\Backup\Backup1\OpenGL_1\csglViewer.cs

?????文件???????1315??2009-03-24?14:03??obj\OpenGL_1\Backup\Backup1\OpenGL_1\drawLegs.cs

?????文件???????5004??2009-03-19?13:22??obj\OpenGL_1\Backup\Backup1\OpenGL_1\drawMan.cs

?????文件???????3321??2009-03-24?20:54??obj\OpenGL_1\Backup\Backup1\OpenGL_1\Form1.cs

?????文件???????6538??2009-03-24?20:48??obj\OpenGL_1\Backup\Backup1\OpenGL_1\Form1.Designer.cs

?????文件???????6017??2009-03-24?14:54??obj\OpenGL_1\Backup\Backup1\OpenGL_1\Form1.resx

?????文件???????4168??2009-03-24?14:25??obj\OpenGL_1\Backup\Backup1\OpenGL_1\loadObjFile.cs

............此處省略166個文件信息

評論

共有 條評論