Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
游客
帖子: n/a
|
![]()
Creating Standalone Virtual Environments
By Edward J. Mayhew, Jr., Quadelta, Inc Send email to Arkadiy Turevskiy Three-dimensional (3-D) synthetic environments provide invaluable information in a range of fields, from civil engineering to cartography and search and rescue. In my own field of aerospace, they are used for flight simulation, post-flight analysis, ground vehicle movement tracking, guidance, navigation, control design validation, and surface ship navigation. The possibilities for creating high-resolution virtual simulations in the MATLAB environment are almost limitless using Virtual Reality Toolbox. You can create synthetic environments that let you fly, drive, or sail virtually anywhere on Earth, the Moon, or Mars. You can display a landscape, including mountains, rocks, clouds, skies, and roads, or an urban scene complete with pavement, 3-D buildings, and airport runways. Flight paths, antenna patterns, jamming effects, orbital mechanics, and robotic operations can all be visualized in geographical or fictitious environments within the Earth's atmosphere or in outer space. This article shows how to solve some of the challenges of creating virtual worlds and describes visualizations that I created using MATLAB with Virtual Reality Toolbox, Image Processing Toolbox, and third-party tools. It covers topics such as finding and using high-resolution and virtual objects from the Web and acquiring terrain data. Creating a Virtual World Creating a virtual world involves finding or building a virtual 3-D object, creating the background, building the virtual world by putting virtual objects and background together, and linking the virtual world to MATLAB or Simulink for analysis. Each step brings its own challenges. The table below summarizes those challenges and offers some solutions. StepChallengesSolutionsFind an object—either purchase one online, export a CAD object, or use the objects provided in Virtual Reality Toolbox.Objects purchased online are often in a variety of formats. You must convert them to VRML before using them in a virtual world.Hundreds of high-resolution 3-D models are available at www.turbosquid.com. NuGraf and Deep Exploration can translate practically any 3-D format into VRML, especially the most popular high-resolution 3-D formats produced by 3D Studio Max, LightWave, or Maya. Create the backgroundBuilding realistic backgrounds can be costly and time-consuming, and it is often difficult to include sufficient detail to create a realistic synthetic environment.World Construction Set and Scene Express provide a range of low-cost resources for building 3-D landscapes--from easily importing practically any terrain data to creating beautiful skies and translating every component to VRML. Build the virtual worldFor the highest resolution for 3-D objects and terrain texture maps, you require at least 2GB of memory and at least 128MB of video card capacity.With Virtual Reality Toolbox there is no limit to the resolution of the 3-D objects beyond those imposed by graphics cards or RAM capacity. The VRML Editor lets you link image files (used as texture maps) to "paint" the surface of a 3-D object, resulting in unprecedented realism. These texture maps can be applied to corresponding terrains. Digital Elevation Model (DEM) data can be "draped" with aerial or satellite images of any resolution to produce detailed, cost-effective background scenes.Link the virtual world to MATLAB or Simulink There is no challenge here—Virtual Reality Toolbox makes this step simple.One line of code is all it takes to brings the virtual world inside the MATLAB environment. Examples of Virtual Worlds Here are some virtual worlds that I created using MATLAB with Virtual Reality Toolbox, Image Processing Toolbox, and third-party tools. I've grouped them into three categories: terrain modeling, radar visualization, and urban environments. Terrain Modeling A-10s flying over Crater Lake, Oregon (Figure 1) This type of scene is perfect for post-flight analysis and verifying flight plans or routes. One challenge was selecting the resolution of the aerial image. The area of this scene is approximately 30 square miles. Too much resolution uses up RAM and increases the time it takes to open the scene. Too little undermines the visual effect. I used a 15-meter resolution image for the terrain texture map to cover the 10-meter digital elevation model (DEM) data underneath it. Lining up the corners of the image with the DEM data perfectly can be tedious, but World Construction Set makes this process simple. The A-10 models were not built in VRML. The axes (X, Y and Z) differ from MATLAB to VRML. Flying in six DoF can be impossible if the aircraft orientation (roll, pitch, and yaw) is incorrectly adjusted. In this case, I had to make the adjustments (to make sure the craft was lying flat and pointing north when the VRML rotation axes were set to [0 0 0 0]) using 3D Studio Max. ![]() Figure 1: Three A-10s flying over Crater Lake, Oregon. After making the alignment I placed one model of the A-10 in the Object Library (Figure 2). I then used V-Realm Builder to place three A-10s in the scene. The whole process took less than two minutes. ![]() Figure 2: The V-Realm Builder Object Library Mars Rover (Figure 3) My visualization of the Rover negotiating the safest route over the rough terrain on Mars uses actual terrain data from Mars, scaled for effect. The Rover virtual object was purchased online and scaled to fit. The greatest challenge here was to create a Mars sky that looked realistic. I did this by experimenting with the colors of the Background embedded into the scene using V-Realm Builder. The nodes that involve color adjustments to the Background include groundColor and skyColor. ![]() Figure 3: The Mars Rover on a "Synthetic" Mars. Forested Island (Figure 4) I built this scene using the tutorial provided in World Construction Set. The instructions were so clear that the entire process took me less than an hour, even though I was new to the tool. I converted the scene to VRML using Scene Express and used Virtual Reality Toolbox to open the scene in MATLAB. Moving or adding cameras to the scene was a snap using the functions in MATLAB and Virtual Reality Toolbox. Balancing the number of trees and other foliage with the size of the scene's area and the available RAM was challenging. It becomes much easier to figure out with experience. ![]() Figure 4. Forested island. Background scene courtesy of 3D Natures' World Construction Set. Golf Course (Figure 5) This scene, from 3Dnature.com, was included with the World Construction Set software. The navigator in Virtual Reality makes navigating through the air or on the ground easy to learn and do. Believe it or not, the navigator makes this scene very light on RAM, and imposes little burden on the processor. Walking on the green or flying through the air can be done by clicking and dragging the mouse. You can change seasons or time of day or night by simply switching sky texture maps. You can zoom in or out of a scene either in code or by using the Virtual Reality Toolbox viewer. ![]() Figure 5: Aerial view of a fictitious golf course. Background scene courtesy of 3D Nature.com. Radar Visualization Southern Nevada (Figure 6) In this scene, primitive cones were used to visualize radars of various sizes, shapes, and colors. Figure 4 shows the scene in the VRML 97 Editor V-Realm Builder. The three radars on the left rotated on their points as the simulation ran. The nodes on the left-hand side of the editor named "Looking_North", "Looking_East", and so on are cameras created and adjusted to capture spectacular simulation effects. Camera can be "locked" onto aircraft or onto particular locations. ![]() Figure 6: V-Realm Builder used to model radar domes in Southern Nevada. Urban Environments Hummer in a Big City (Figure 7) This is a very good example of the use of texture maps to create high-resolution urban environments. Of course, cameras can be placed anywhere in the scene, including the moving Hummer. In this particular scene it was challenging to capture the movement of the Hummer. Placement is critical for realistic 3-D animation that can be recorded to an AVI file. Rolling with turns, the pitch of the Hummer, and traveling down the highway with reasonable accuracy all have to be calculated by MATLAB or Simulink. I built a MATLAB GUI to move the Hummer anywhere in the scene and record its position. With all the positions saved, recording the movements to an AVI file using MATLAB code was quick and easy. ![]() Figure 7. Hummer in a big city. Extending Virtual Worlds I continue to use Virtual Reality Toolbox to enhance my MATLAB applications with cost-effective, high-resolution, 3-D virtual environments. With Virtual Reality Toolbox, the exchange between processed data and visual effects is seamless and immediate--especially important for stand-alone applications. The 3-D objects in the virtual world have immediate access to MATLAB and Simulink mathematics, providing extensive modeling and simulation capabilities and making the virtual world and the 3D objects inside it as dynamic as MATLAB and Simulink. Features that I am currently working on include the following:
更多... |
![]() |