首页 > 其他分享 >159.235 2023 S02 Wireframe Data Viewer

159.235 2023 S02 Wireframe Data Viewer

时间:2024-09-18 15:37:52浏览次数:1  
标签:wireframe java Viewer S02 Wireframe will marks need data

159.235 2023 S02 — Assignment 2

This assignment covers the topics: coordinates, transformations, 3d modelling, and visiblesurfaces.

Wireframe Data Viewer

Write a Java program that renders a 3 dimensional triangle wireframe surface data modeland allows one to rotate and scale the model so that it can be viewed from any direction.This could be thought of as a simple CAD program.Your application needs to be set up so that the figures rotate as the sliders are adjusting,they uniformly resize after clicking the appropriate button, and they get re-drawn whentoggling between anti-aliasing on/off.Use the simple viewing model where the “eye” point is on the positive z-axis looking downand the figures are drawn by orthographically projecting onto the xy-plane.You will need to decide how to transform the vertex coordinates in the wireframe data forthe given rotations and scalings. You can then draw each triangle on the Graphics2D canvaswith the transformed vertex positions.Your rendered wireframe figures should appear “solid”—the wireframe outlines should beclearly visible. You need to implement some procedure to remove hidden surfaces. Youshould at least implement the back face culling method. You should find that this willemove most hidden surfaces—but not all of them. Top marks will be earned by thoseprograms that are able to remove all hidden surfaces.Sample triangle mesh wireframe data files are provided on Stream. You program shouldwork smoothly with all of them.You do not need to implement the 2D viewport clipping procedures described in the lectures.You can let the Java AWT handle all that.You do not need to apply any lighting or shading to the surfaces—this will be dealt withlater on in the course.

Completing the assignment

A set of startup Java source files are on Stream that will function as skeleton code forthe assignment. Load these into a new IntelliJ project and start up Main.java—this is the“controller” part of your project. This features a number of JPanels with slider and buttonwidgets. Familiarize yourself with the various components in the project folder.To complete the assignment, provide implementations for the other components. Whendoing so you will need to make small adjustments to Main.java—mostly in the event handlermethod. Complete as follows:

  1. The Wireframe.java file contains a class that holds 代 写159.235 2023 S02 Wireframe Data Viewerall data for a given triangle meshfigure. Decide what data needs to be stored there. Provide an implementation inWireframeDataIO.java to read from a wireframe .tri file and create a new instance ofWireframe[2 marks]
  1. Complete the implementation of the rotation matrix utilities in Transform3d.java. Thepurpose of this utility is to be able to readily generate a full rotation matrix givenrotation angles in each of the 3 planes.[2 marks]
  1. Make appropriate modification to the Wireframe class so that these rotations, as wellas scaling, can be applied to the triangle mesh data.[3 marks]
  1. Provide an implementation in WireframeDrawer.java to draw the triangles on a JPanelusing the transformed vertex positions. This needs to happen directly in response toadjusting the sliders and clicking the buttons.[3 marks]
  1. Provide an implementation of back face culling. You will need to decide the appropriateplaces in your project to make the modifications.[4 marks]
  1. Further modify your project to implement the Painter’s Algorithm. Here you will needto decide on a suitable approach for defining the “depth” of your triangles and how tosort them.[4 marks]
  1. Implement the action following the anti-aliasing buttons, so that the lines will bedrawn with anti-aliasing either on or off. Decide how this will be actioned in the Maincontroller. For this part is enough to use the anti-aliasing tools built-in with the JavaAWT.

[2 marks]

Due date: 2024 September 20, 11:55pm.Please submit via the submission link on Stream.Total 20 marks (20% of your final grade).Coding hints

  • To read and parse a text file (as in the wireframe data files), the JDK suppliedjava.util.Scanner class is a useful utility. Create a Scanner object and use the .nextLine()method to step through the file line-by-line. This method will give you a line in a file asa String. Note: to use this utility, you will need to handle the FileNotFoundException.
  • There are situations where you will need to split a String into sub-strings according tosome delimiter (e.g. space, tab, comma, . . . ). Use the java.util.StringTokenizer forthis.
  • To convert a String to a numeric value, use Integer.parseInt() or Double.parseDouble().
  • It is suggested that you draw each triangle using something like:

// xDraw and yDraw are s i z e 3 arrays g iv ing the t r i angle ver tex pos i t ions

Polygon aTriangle = new Polygon(xDraw, yDraw, 3);

// . . . ass ign values to aTriangle . . .

// The implementation d e t a il s w i l l depend upon how you have

// designed your program

g2.setColor(Color.gray);

g2.fill(aTriangle);

// Colour in the t r i angle sur face

g2.setColor(Color.black);

g2.draw(aTriangle);

// Draw the t r i angle ou tl ine

Note that xDraw and yDraw are integer arrays.

标签:wireframe,java,Viewer,S02,Wireframe,will,marks,need,data
From: https://www.cnblogs.com/WX-codinghelp/p/18418630

相关文章

  • Springboot汉中公交线路查询系统的设计与实现7ts02
    本系统(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。系统程序文件列表开题报告内容一、研究背景随着汉中市城市化进程的加速,公共交通在市民生活中扮演着越来越重要的角色。然而,现有的公交线路查询方式多依赖于纸质地图或传统查询系......
  • 【Ehviewer绿色版】1.9.8.4最新版本下载2024安卓苹果
     Ehviewer是一款主要用于浏览和下载漫画、插画等二次元图像内容的软件。适用安卓和苹果系统,Ehviewer拥有海量的漫画作品,涵盖各种题材和风格,包括日本漫画、韩国漫画、欧美漫画以及国内的一些同人创作等。无论是热门的商业漫画还是小众的独立作品,都能在Ehviewer上找到,现在已经更......
  • 魔兽世界地心之战第一赛季开启,GameViewer远程助你随时随地手机玩魔兽世界
    “地心之战”第1赛季正式开启,本次11.0更新了地下堡玩法,地下堡是11.0新增的全新pve玩法,拥有海量奖励,想要获得奖励,每周的大小周常(1大4小)也非常重要,要给开地下堡丰裕宝箱的钥匙,地下堡解锁高层后,直接就能从丰裕宝箱开出603装备,低保给616装备(需要完成2次)。地下堡同时也是最适合孤......
  • Cesium源码解读之Viewer(全网最全)
    今天我们来扒一扒cesium的源码,探寻一下底层的奥秘,我们平时工作中用的最多的应该就是varviewer=newCesium.Viewer('cesiumContainer');这句了但我们却很少去了解他底层是否如何实现的。首先我们可以通过Source/Cesium.js找到api的入口然后一步步往下走....这个是我理的......
  • OHIF Viewer 基础查看器的相关
    新版的ohif 封装的很好,跟3.8版本的 viewer修改成app  ui组件进行了整改3.9版本的更新OHIFViewer3.9相对于3.8版本进行了多项改进和更新。以下是一些主要的改进点:1.性能优化:在3.9版本中,团队对性能进行了优化,特别是针对大型数据集的加载和渲染速度,减少了延......
  • OOP-class02
    Chapter8ObjectandClass对象的概念:对象就是一个相关的实体,就像桌子,椅子这种类型的相关的对象,对于不同的对象就会存在着多个不相同的特征每个对象当中也具有着多个不同的属性,一个对象中具有着在客观实在中能够被唯一进行识别出来的,具有唯一性总结:对象就是在客观世界中能够......
  • [Meachines] [Easy] Remote NFS备份文件泄露+Umbraco-RCE+TeamViewer权限提升
    信息收集IPAddressOpeningPorts10.10.10.180TCP:21,80,111,135,139,445,2049,5985,47001,49664,49665,49666,49667,49678,49679,49680nmap-p-10.10.10.180--min-rate1000-sC-sVPORTSTATESERVICEVERSION21/tcpopenftp......
  • Teamviewer内网怎么用
    在企业内网环境中,安全性、稳定性和性能是企业用户关注的重点。然而,许多远程控制软件在内网应用中存在限制,无法满足企业的特殊需求。比如知名的远程控制软件TeamViewer,其功能强大,但并未提供适合企业内网环境的解决方案。针对企业内网环境,目前公认好用的是SplashtopOn-Prem解决......
  • photo-sphere-viewer全景图使用案例
    1.安装photo-sphere-viewer,两种方式都可以npminstall@photo-sphere-viewer/coreyarnadd@photo-sphere-viewer/core2.项目中去引入 import{Viewer}from'photo-sphere-viewer'import*asPhotoSphereViewerfrom"photo-sphere-viewer/dist/adapters/cubema......
  • 如何在DasViewer中把不同季节的模型调成一样的颜色?
    答:三维模型出现各种色差主要是因为原始照片色差造成的。比如外业航飞时的时间、季节、天气条件不一,相机的色调、清晰度、曝光等参数设置不同等,原始照片的色差会直接影响到后续三维模型的色彩表现,造成颜色不统一。为消除模型色差,需要对原始照片或者模型进行调色处理。针对图中......