首页 > 其他分享 >SC3060: Computer Graphics and Visualization

SC3060: Computer Graphics and Visualization

时间:2024-09-08 20:16:57浏览次数:12  
标签:Visualization functions marks coordinates will Computer lab Graphics your

SC3060: Computer Graphics and Visualization

SW Lab or Your Own Computer

Making Images with Mathematics

Lab Experiments 1 - 5

SESSION 2024/2025

SEMESTER 1

COMPUTER SCIENCE COURSE

MAKING IMAGES WITH MATHEMATICS

1. OBJECTIVE

In this coursework you will learn how to visualize curves, surfaces and solid shapes defined by simple mathematical formulas. Each of 5 experiments takes 2 hours. Upon completion of these experiments you will know:

•   How to define shapes by parametric and implicit functions, and

•   How to transform. and animate shapes.

2. EQUIPMENT

You have to install the latest version of ShapeExplorer from the course site. The software is available for Windows, MacOS and Linux (Ubuntu). You can work on the lab assignments using your either the computers in the lab and your own computers.

3. INTRODUCTION

In this labs, you will learn how to define geometric shapes by mathematical formulas which are used to compute coordinates of all the points belonging to the shapes. You will be using ShapeExplorer (Fig.  1) which is an interactive software tool designed to display shapes defined by parametric and implicit function scripts and colors defined by explicit functions. It can run on Windows, MacOS and Linux (Ubuntu) computers. Shape  Explorer is just one interactive window where you can type the definitions scripts and other parameters. The definitions can be saved in a proprietary format and loaded later to the software to continue working with them. Shape  Explorer supports only one shape visualization at the time. Its purpose is to work as a quick all-in-one multi-platform. visualization tool.

Figure 1.   ShapeExplorer at a glance.

Parametric functions in ShapeExplorer are explicit functions of up to three variables u, v, w (which are called parameters) and time t. They can define Cartesian coordinates x,y, Z  of curves, surfaces and solid objects. To define a curve, only one parameter u, v or w  has to be used, to define a surface–any two parameters u ,v v, w or u, w are required, for solid objects– all three parameters u, v, w have to be used. When t is added, these objects will become time- dependent. The examples of defining parametrically curves, surfaces and sold objects are given in Figs. 2, 3 and 4.

Figure 2. Displaying a parametric curve.

Figure 3. Displaying a parametric surface.

Figure 4 Displaying a parametric solid.

Implicit functions are the functions defined as f(x,y, z, t) =0, where x,y, z  are Cartesian coordinates and tis the time. You will only use them for defining surfaces. The implicit functions are equal to zero for the points located on the surface. By changing this equality into an inequality g = f(x,y, z, t)≥0, known  in computer graphics as FRep, we define not only a surface but the space bounded by this surface, or a half-space. In this case, the function equals to zero for the points located on the surface, positive values of the function indicate points inside the solid object, and negative values are for the points which are outside the object. In the ShapeExplorer script. field, only the left part of the implicit or FRep function has to be written – it is always assumed to be ≥0. The example of defining a surface is given in Fig. 5 and a definition of the solid object using set-theoretic (Boolean) operations is illustrated in Fig. 6.

Defining  shapes  and  animations  may  require  multiple  formulas  and  temporary  variables. ShapeExplorer supports a subset o 代 写SC3060: Computer Graphics and Visualizationf C# language for writing definition scripts. The following mathematical functions are supported:

abs, sqrt, exp, log, sin, cos, tan, acos, asin, atan, ceil, floor, atan2, mod, round, max, min, cosℎ, ssinℎ, tanℎ, log10.

There is also if{ } else { } operator. Variables, x,y, z are reserved for Cartesian coordinates, while variables u, v, w are parametric coordinates. Variable t is reserved for defining the time. All other variable can be used without declaration—they will be declared as float.

Figure 5 Displaying an implicit surface. Both sides of the surface are visible.

Figure 6 Displaying an implicit solid. The inner surface of the object is not visible in solids.

For defining r,g, b diffuse colors, scripts with explicit functions of coordinates x,y, Z have to be used:

r|g |b = f(x,y, Z, t); r,g, b ∈ [0,1] . Thus the color is defined for any point of the 3D modelling space and it is then sampled by the geometry (see Fig. 7). Constant colors can also be defined as r|g |b = value ∈ [0,1];

Figure 7 Defining diffuse colors as functions of coordinates.

In addition,  in the Visual Appearance fields the Specular Color [0,1], Shininess [0,1] and Transparency [0,1] values can be defined. Specular Color affects overall illumination of the object. It is responsible for displaying reflections or specs on the surface of objects. Parameter Shininess controls the size of such specs. Colors of curves can be only defined if Shininess is set to 1.

The remaining Animation fields (Fig. 7) contain TimeSpan and CycleInterval. The TimeSpan contains minimum and maximum values of the time values between which it will be incremented in a cyclic manner. These values can be positive and negative. The TimeSpan interval then is mapped to the real time interval CycleInterval in seconds – this is how the animation will be then displayed.

Options fields  (Fig.  7) contain  parameters of the  coordinate axes, an option to toggle to wireframe. visualization mode, and background color. Coordinate axes can be scaled—shorten with the scaling parameters less than 1 or elongated with the scaling parameters greater than 1. Scaling coefficient 0 will toggle off the respective axis.

4. EXPERIMENTS

There are 5 lab sessions comprising 5 experiments:

1. Parametric Curves

12 marks

2. Parametric Surfaces

12 marks

3. Parametric Solids

12 marks

4.  Implicit Surfaces and Solids. Colors and 3D Textures

12 marks

5.  Animation

12 marks

Total:

60 marks

All the experiments are personalized, i.e. each student will have different data to work with. The personalization is based on using two last digits of your matriculation number:

U1234567G

NM

which can be integer numbers from 0 to 9 where 0 will stand for 10. Therefore, the two numbers from 1 to 10 will define your personal variant of the assignments. These numbers will be further referred to as for penultimate digit and for the last digit.

This is an individual assignment.

In the remaining part of the manual, you will find the assignment instructions. Each of the five lab assignments will be evaluated and awarded up to 12 marks. Partial marks are indicated in the assignment instructions.

After completion of each of five lab assignment, you have to write a report following the template shown in Fig. 8.

WITHIN ONE WEEK (7*24 HOURS) AFTER THE END OF EACH OF FIVE SCHEDULED LAB SESSION you have to do the following:

1.       Create  a  folder  and   name   it exactly as  your   name   is  written  on your matriculation card and add as a suffix the two last matric number NM, e.g., JAMES BOND 67.

2.       Copy to this folder the scan/photo of your matriculation card with clearly readable name, photo, and at least three last characters of the matriculation number. Do not make any additional subfolders

3.       Copy to this folder the PDF fie of the report and all the relevant *.func files.

4.       Zip your assignment folder. The zipped file must have the same name as your folder, e.g., JAMES BOND 67.zip. Please check that your file can be unzipped to the folder with your name.

5.       Submit the zipped file through the respective digital drop box in the lab website (note that website has been created for each lab group).

6.       Check your email  box  regularly. The lab instructors or subject coordinator will email you if something is wrong.

CZ2003: Lab # 1 {, 2, 3, 4 or 5}

Q1a

A screenshot of the shape displayed with coordinate axes (lab 1-4) or 3 screenshots from animation (lab 5)

Name of the file: Q1a.func (for labs 1-3) or Q1.func (for lab 4 and 5)

Q1b

A screenshot of the shape displayed with coordinate axes (lab 1-4)

Name of the file: Q1b.func (for labs 1-3)

Q1c

A screenshot of the shape displayed with coordinate axes (lab 1-4)

Name of the file: Q1c.func (for labs 1-3)

Q1c

A screenshot of the shape displayed with coordinate axes (lab 1-4)

Name of the file: Q1d.func (for labs 1-3)

Q2

A screenshot of the shape displayed with coordinate axes (lab 1-4) or

3 screenshots from animation (lab 5)

Name of the file: Q2.func

Q3

A screenshot of the shape displayed with coordinate axes (lab 1-4) or

3 screenshots from animation (lab 5)

Name of the file: Q3.func

Figure 8. Template of the report.

4.1 Experiment 1: Parametric Curves

This assignment illustrates Module 3, and it serves a purpose to teach you how to visualize curves defined by parametric functions. To work on this assignment, you have to watch the following TEL lectures:

Module 1:  Lecture 2 (Part 3) - Introduction to Computer Graphics and Foundation Mathematics {Rene Descartes and coordinate systems}

Module 3:  Lecture 1 (Part 2/3) - Geometric Shapes: 2D Curves {straight-lines}

Module 3:  Lecture 1 (Part 3/3) - Geometric Shapes: 2D Curves {straight-lines}

Module 3:  Lecture 2 (Part 1/3) - Geometric Shapes: 2D Curves {circle}

Module 3:  Lecture 2 (Part 2/3) - Geometric Shapes: 2D Curves {circle and beyond}

Module 3:  Lecture 2 (Part 3/3) - Geometric Shapes: 2D Curves {ellipse and summary}

Module 3:  Lecture 3 - Geometric Shapes: 3D Curves

Assignment instructions:

Create folder Lab1.  Download  into  it  from the course-site the file ParametricCurve.func (Fig. 9). Use it as a reference for the following exercises with curves. For each of the displayed curves, you have to select a sampling resolution providing for smooth curve visualization. Each of the curves has to be displayed within 1 sec and using red color with black coordinate axes on the white background.

1.       Using  functions  x (u), y(u), u  ∈  [0,1],  define  parametrically  in  4  separate  files  and display:

a.       A straight line segment spanning from the point with coordinates (-N,-M) to the point with coordinates (M,N).

b.       A circular arc with radius and the polar angle spanning from  to 2π , centered at point with coordinates (N,M).

c.       An  origin-centered  2D  spiral  curve  which  starts  at  the  origin,  makes N+M

revolutions clockwise (as counted from the positive axis X) and reaches eventually the radius 2*M.

d.      A 3D cylindrical  helix with radius N which is aligned with axis Z and makes M clockwise revolutions about it (as counted from the positive axis X) while spanning from z1  = −N to z2  = M.    (4 marks)

2.       Based  on  the  explicit  definition  of  the  curve  with  number (Table  1),  derive  its parametric representation x (u), y(u), u ∈ [0,1], and then modify it to scale and translate the curve so that it will make N full periodic oscillations*  within the given x-domain (Fig. 10). Display the curve.   (4 marks)

3.       A so-called “butterfly curve” is defined in polar coordinates by:

r = esin − 2cos + sin5  T

Derive its parametric representation in Cartesian coordinates as x (u), y(u), u ∈ [0,1] and display the curve with the centre at coordinates (NM).    (4 marks)

Figure 9.   Displaying the shape defined in ParametricCurve.func.

 

标签:Visualization,functions,marks,coordinates,will,Computer,lab,Graphics,your
From: https://www.cnblogs.com/qq--99515681/p/18403350

相关文章

  • 获取QGraphicsRectItem内的矩形的坐标,坐标是相对于整个场景的
    要点一个QGraphicsRectItem的坐标,受两个因素影响,QGraphicsRectItem本身针对于场景的坐标,QGraphicsRectItem内的矩形相对于这一点的坐标。获取QGraphicsRectItem的坐标在Qt中,QGraphicsRectItem 是 QGraphicsItem 的一个子类,用于表示矩形图形项。要获取 QGraphicsRectI......
  • COMP90086 Computer Vision
    COMP90086Computer Vision,2024Semester 2Assignment2: PatchmatchingwithneuralnetworksIntroductionFindingcorrespondencesbetweenkeypointsisacriticalstepinmanycomputervisionapplications. It can be used to align images when constr......
  • c#中Graphics常用的属性
    Graphics介绍在C#中,Graphics类是System.Drawing命名空间的一部分,它提供了用于绘制线条、形状和图像的方法。Graphics对象通常与Graphics类的FromImage、FromHdc、FromHwnd等方法一起使用,以获取用于绘制的Graphics对象。以下是一些Graphics类中常用的属性和方法:......
  • 如何在Pyqt中渲染使用svggraphicsItem的SVG字形?
    在使用PyQt构建应用程序时,有时需要在图形用户界面中渲染SVG(可缩放矢量图形)文件,特别是当你需要显示图标或自定义字体时。QGraphicsSvgItem是PyQt提供的一个类,用于在QGraphicsView或QGraphicsScene中渲染SVG图像。然而,如果你想使用SVG字形或通过编程方式生成矢量图形,QS......
  • 2024年数字经济与计算机科学国际学术会议(DECS2024) 2024 International Conference on
    文章目录一、会议详情二、重要信息三、大会介绍四、出席嘉宾五、征稿主题六、咨询一、会议详情二、重要信息大会官网:https://ais.cn/u/vEbMBz提交检索:EICompendex、IEEEXplore、Scopus大会时间:2024年9月20-22日大会地点:中国-厦门终轮截稿日期:2024年9月16日(早投......
  • FIT1047 Introduction to computer systems, networks and security
    FIT1047 Introductiontocomputersystems, networksand security-S2 2024Assignment2– Processesand MARIE ProgrammingPurposeProcessesandprogramsarewhatmakescomputers do what we want them to do. Inthefirst partofthisassig......
  • FIT1047 Introduction to computer systems, networks and security
    FACULTYOFINFORMATIONTECHNOLOGYFIT1047Introductiontocomputersystems,networksandsecurity–S22024Assignment2–ProcessesandMARIEProgrammingPurposeProcessesandprogramsarewhatmakecomputersdowhatwewantthemtodo.Inthefirstp......
  • QT在控件graphicsView中绘制箭头
    这里写自定义目录标题前言:基础夯实:成功效果展示:失败效果展示:核心代码:前言:对之前箭头没有成功绘制的补充,因为没有直接的箭头项,所以需要自己进行绘制基础夯实:可以直接看,建议看一下之前的绘制过程在控件graphicsView中实现绘图功能(一)在控件graphicsView中实现绘图功......
  • C# split big picture into small pieces via graphics
    usingSystem;usingSystem.Collections.Generic;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows;usingSystem.Windows.Controls;usingSystem.Windows.Data;usingSystem.Windows.Documents;using......
  • Graphics2D绘图方法总结
    一、简介在开发中可能会遇到这样一类场景,业务复杂度不算太高,技术难度不算太深,但是做起来就很容易把人整破防,伤害很高侮辱性很强的:绘图。绘图最怕有人挑刺:这里变形,那里不对,全图失真。最近在处理这样一个场景,使用Java的Graphics2D类,绘制业务需要的图形模板,然后在具体流程中填充数......