• PUDN用户
    了解作者
  • C++ Builder
    开发工具
  • 4MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 121
    下载次数
  • 2005-09-19 13:45
    上传日期
德国Signsoft公司的用于Opengl编程的控件,可直接调用.3ds文件创建虚拟仿真环境,这是另外几个事例包。有兴趣的刻意一起研究!
signsoft.rar
  • signsoft
  • Extrusion
  • Unit1.h
    2.5KB
  • Main.dfm
    8.1KB
  • Extrusion.cpp
    710B
  • Unit1.dfm
    5.7KB
  • Extrusion.obj
    15.4KB
  • Main.cpp
    5.3KB
  • Extrusion.bpr
    3.8KB
  • Extrusion.RES
    1.9KB
  • Main.h
    2.5KB
  • Main.obj
    175.8KB
  • Unit1.cpp
    4.5KB
  • Robot
  • Unit2.h
    781B
  • Robot.cpp
    704B
  • main.~dfm
    307.5KB
  • main.~cpp
    17.5KB
  • AboutDemo.cpp
    524B
  • AboutDemo.dfm
    1.1KB
  • main.obj
    214KB
  • main.cpp
    17.5KB
  • Robot.tds
    2.9MB
  • main.ddp
    51B
  • Unit2.obj
    34.9KB
  • Robot.RES
    1.9KB
  • main.h
    3.2KB
  • main.dfm
    307.6KB
  • Unit2.cpp
    516B
  • Robot.bpr
    3KB
  • main.~h
    3.2KB
  • AboutDemo.h
    805B
  • Robot.obj
    15.3KB
  • Unit2.dfm
    1.1KB
  • Robot.exe
    1.1MB
  • Bounce
  • Main.dfm
    10.1KB
  • Bounce.tds
    1.7MB
  • Bounce.cpp
    707B
  • Main.cpp
    8.7KB
  • Main.h
    2.9KB
  • Bounce.bpr
    4KB
  • Bounce.RES
    1.9KB
  • Main.obj
    562.8KB
  • Bounce.exe
    904.5KB
  • Bounce.obj
    411KB
  • Shadow
  • Project.RES
    1.9KB
  • Shadow.obj
    184.5KB
  • Shadow.cpp
    5KB
  • Project.cpp
    698B
  • Shadow.dfm
    201.3KB
  • Project.bpr
    3.2KB
  • Shadow.h
    2.2KB
  • Project.exe
    1MB
  • Project.tds
    2.8MB
  • Project.obj
    15.1KB
  • Basics
  • Basics.cpp
    623B
  • Basics.RES
    1.9KB
  • MainWindow.dfm
    442.1KB
  • Basics.tds
    1.4MB
  • MainWindow.~cpp
    3.4KB
  • Basics.exe
    1MB
  • MainWindow.~dfm
    442.1KB
  • MainWindow.ddp
    51B
  • MainWindow.obj
    555.6KB
  • MainWindow.h
    1.9KB
  • vssver.scc
    112B
  • Basics.bpr
    4KB
  • MainWindow.~h
    1.9KB
  • Basics.obj
    411KB
  • MainWindow.~ddp
    51B
  • MainWindow.cpp
    3.4KB
  • Basics.~bpr
    3.9KB
  • www.pudn.com.txt
    218B
内容介绍
//--------------------------------------------------------------------------- ////////////////////////////////////////////////////////////// //Signsoft VisIt: Robot vehicle // ////////////////////////////////////////////////////////////// //This program demonstrates how to // // -perform measurements in an artificial environment // // using the method GetPoint, // // -create advanced objects using SetReliefBitmap, // // -use texture mapping, fog, light, materials and nodes, // // -apply basic VisCanvas methods, // // -speed up the rendering by lowering the detail and by // // switching off unimportant features. // //The robot within the scene is controlled based only on // //distance information from three scan points. The scene is // //created randomly. // ////////////////////////////////////////////////////////////// #include <vcl.h> #include <math.h> #include <stdlib.h> #pragma hdrstop #include "Main.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "VisAttr" #pragma link "VisCam" #pragma link "VisCanvasView" #pragma link "VisClass" #pragma link "VisCntrl" #pragma link "VisComp" #pragma link "VisGeom" #pragma link "VisLight" #pragma link "VisMat" #pragma link "VisObj" #pragma link "VisPrimitiveObj" #pragma link "VisShape" #pragma link "VisTex" #pragma link "VisTimer" #pragma link "VisView" #pragma resource "*.dfm" struct TBoxData { TVisMathVector transform; TVisMathVector dims; }; TForm1 *Form1; TBoxData Boxes[10]; //obstacles Integer TurnAngle; //angle the robot still has to be turned Boolean OVCam; //OvervieCam used? double SensorData[3]; //data from the scan points double speed; //current speed of the robot Boolean stencilinit; //will be set after stencil is inited once //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- double __fastcall sqr(double value) { return value*value; } //--------------------------------------------------------------------------- void __fastcall CreateEnvironment() { Integer a,ang; //set random obstacles for (a=0;a<=9;a++) { Boxes[a].transform=ToVec(random(90)/100.0+0.1,random(90)/100.0+0.1,random(360)); Boxes[a].dims=ToVec(random(8)/100.0+0.02,random(10)/100.0+0.06,random(8)/100.0+0.02); } }//CreateEnvironment //--------------------------------------------------------------------------- void __fastcall TForm1::Exit1Click(TObject *Sender) { Close(); } //--------------------------------------------------------------------------- void __fastcall TForm1::About1Click(TObject *Sender) { ShowAboutDlg(); } //--------------------------------------------------------------------------- void __fastcall TForm1::AboutDemo1Click(TObject *Sender) { Form2->ShowModal(); } //--------------------------------------------------------------------------- void __fastcall TForm1::OverviewCam1Click(TObject *Sender) { //change camera to overview: OVCam=true; OverviewCam1->Checked=true; VisFog1->EndDepth=2; RoboSphere->Enabled=true; Wheel1->Slices=8; Wheel3->Slices=8; Wheel2->Enabled=true; Wheel4->Enabled=true; VisView1->Controller=VisMouseController1; } //--------------------------------------------------------------------------- void __fastcall TForm1::RoboCam1Click(TObject *Sender) { //change camera to RoboCam OVCam=false; RoboCam1->Checked=true; VisFog1->EndDepth=0.5; RoboSphere->Enabled=false; Wheel1->Slices=20; Wheel3->Slices=20; Wheel2->Enabled=false; Wheel4->Enabled=false; VisView1->Controller=NULL; } //--------------------------------------------------------------------------- void __fastcall TForm1::GroundRectAfterInit(TObject *Sender) { //The texture of the ground is also used as a relief: if (Fulldetail1->Checked) GroundRect->SetReliefBitmap(VisTexture1->Bitmap,0.015,2,2); } //--------------------------------------------------------------------------- void __fastcall TForm1::BoxAfterInit(TObject *Sender) { //when the detail is low the relief does not resemble the bitmap //but causes interesting distortions as for the obstacles: if (Fulldetail1->Checked) Box->SetReliefBitmap(VisTexture2->Bitmap,0.05,2,2); } //--------------------------------------------------------------------------- void __fastcall TForm1::NoDetail1Click(TObject *Sender) { //lower detail: RoboSphere->Textured=false; RoboSphereAttr->Lighting=true; NoDetail1->Checked=true; Box->Textured=false; Box->DetailX=1; Box->DetailY=1; Box->DetailZ=1; Box->Material=BoxMat; FastBox->DetailY=1; GroundRect->Textured=false; GroundRect->DetailX=1; GroundRect->DetailY=1; GroundRect->Material=GroundMat; VisFog1->Enabled=false; RoboCam->ViewFar=2; SceneAttr->ColorAmbient->Color= TColor(0x00111111); SceneAttr->ShadeModel=smFlat; } //--------------------------------------------------------------------------- void __fastcall TForm1::Fulldetail1Click(TObject *Sender) { //full detail: Fulldetail1->Checked=true; RoboSphere->Textured=true; RoboSphereAttr->Lighting=false; Box->Textured=true; Box->DetailX=3; Box->DetailY=3; Box->DetailZ=3; Box->Material=NULL; //Only the detailY of the FastBox is raised. Raising all //details would be little more accurate but much slower: FastBox->DetailY=3; GroundRect->Textured=true; //the high ground detail is necessary for the relief: GroundRect->DetailX=50; GroundRect->DetailY=50; GroundRect->Material=NULL; VisFog1->Enabled=true; //ViewFar can be low because the fog covers the scene: RoboCam->ViewFar=0.5; SceneAttr->ColorAmbient->Color=clYellow; SceneAttr->ShadeModel=smSmooth; } //--------------------------------------------------------------------------- void __fastcall TForm1::FastBoxAfterInit(TObject *Sender) { //distort the FastBox (used only scanning) in the same //way like the displayed box: if (Fulldetail1->Checked) FastBox->SetReliefBitmap(VisTexture2->Bitmap,0.05,2,2); } //--------------------------------------------------------------------------- void __fastcall TForm1::New1Click(TObject *Sender) { CreateEnvironment(); } //--------------------------------------------------------------------------- void __fastcall TForm1::VisView1Resize(TObject *Sender) { stencilinit=false; } //--------------------------------------------------------------------------- void __fastcall TForm1::VisView1Render(TVisView *aView) { Integer a,r; TVisBox *CurBox; TVisMathVector p; TVisBufferType bt; bt = bt<<btStencil; //rear view stencil is only drawn once and not cleared during rendering //Attention: the resize event of the view also has to invalidate the stencil! if (! stencilinit) { //clear stencil buffer: VisView1->ClearBuffers(bt); //draw only stencil (no colors, no depth information): VisView1->SetStencilMode(smDrawStencil); //render the stencil for the rear view: //(objects rendered here will specify the stencil, //3d-objects can be rendered as well as 2D canvas shapes) r=aView->Width /13; VisView1->Canvas->Rectangle(Rect(aView->Width /2-50,4,aView->Width /2+85,4+2*r)); VisView1->Canvas->Ellipse(Rect(aView->Width /2-50-r,4,aView->Width /2-50+r,4+2*r)); VisView1->Canvas->Ellipse(Rect(aView->Width /2+85-r,4,aView->Width /2+85+r,4+2*r)); //set viewport for camera according to screen size. The viewport defines the drawing rect and //thereby the proportions of the landscape within the rear view. RearCam->Viewport-
评论
    相关推荐
    • 3ds+opengl.zip
      读取.3ds文件,可以实现简单的读取功能,后续需要自己修改,底层面、法线等具体内容
    • 3DS文件读取 opengl
      读取3DS文件,以OPENGL作为工具,显示模型,实现鼠标拖动旋转,右键放大、缩小
    • Opengl查看3ds文件
      这个软件是用来查看3ds模型的.也可以用来做漫游系统引擎.包含了碰撞检测,空间分割等功能.目前还没有加入对文理的支持,下一版本将添加
    • OpenGL Load3DS OpenGL Load3DS
      OpenGL Load3DS OpenGL Load3DS OpenGL Load3DS
    • OpenGL读取3DS模型
      本程序用C++编写,可以使用OpenGL工具读取并显示3DS模型。
    • opengl lib3ds
      .3ds文件是OBJ的二进制形式,并且多很多信息。有一个C语言写的开源库可以用来加.3ds文件,这就是lib3ds
    • opengl显示3ds程序
      利用opengl语言显示3ds文件的小程序
    • opengl 3ds loader
      opengl 演示 装载3ds模型 简单例子 只能装载小的3ds文件 而且只读取某些数据结构
    • OPENGL+3DS
      opengl3ds混合使用
    • opengl读入3ds
      在VC++单文档环境下实现3ds文件格式的读入