联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-10-07 03:24

159.235 Assignment 3 - A 3D Graphics Scene

This assignment covers the concepts of coordinate transformations (in homogeneous coordinates),

ray tracing, illumination shading, and texture mapping.

Getting started

On the Stream site, are provided some startup .java code together with some images you

can use as texture maps.

• Bring up IntelliJ and create a new project - call it Assignment3 (or whatever you like).

• In your project, create a new package called nz.ac.massey.graphics.toybox

• Copy all the .java files from Stream in to the package folder in IntelliJ.

• Copy the images into the top level folder of your project.

• Run Main.java from IntelliJ. You should see a JPanel/JFrame with a little blue square

at the centre. This is the view of the graphics scene from the point-of-view of an

imaginary camera placed on the z-axis and looking down.

• Have a look at the code and read the comments and figure out what is going on. Note

that the planar surface is rendered by the ray tracing method.

• Our initial graphics scene comprised just of a unit xy-plane centred on the world

coordinate origin. Try changing the size, orientation, and displacement of the plane

and see what happens.

• Try changing the camera position and see what happens.

• Try and create 6 planes and manipulate them so that they form the 6 faces of a cube.

The assignment proper

The project is incomplete in that it doesn’t implement visibility, ray tracing on spherical

surfaces, illumination shading, and texture mapping.

1. Modify the Camera class to implement the technique of z-buffering for visibility. See

the lecture notes on how it works.

2. Complete the code for the Sphere class to implement ray tracing for spherical surfaces.

Note that in this class you are working in local coordinates of the surface object.

3. Complete the calcShading() method in the Surface class. This should calculate the

correct shading factor, to apply to a colour, according to the standard local illumination

model.

4. This class holds a BufferedImage that holds a texture image and allows one to pick a

colour from the image given the normalized texture coordinates (u, v). Complete the

implementation of the pickColour() method.

With these tasks complete, use your project to generate a realistic 3D graphics scene comprising

planar and spherical surfaces.

Requirements

To get high marks you should showcase the following:

• A plane surface with a texture pasted on it.

• The visible faces of a uniform colour cube correctly placed and shaded.

• A uniform colour sphere with a shiny surface (ie specular highlight)

• A sphere with a texture pasted on it (eg the beachball)

To get full marks you should generate a scene that adds more to the above. Marks will be

awarded for initiative. Be creative!

Note

• Do not use OpenGL. Do not use Java 3D. Do not use java.awt.GradientPaint.

• A graphical user interface is not required in this assignment. Your program should

directly display the rendered scene to the screen upon running the program. An additional

class Display is provided to do that.

• This assignment will count up to 15% of your final grade.

• Due date: 2019 October 20, 11:55 pm.

Appendix

You are not required to do any of the following here. However, it is interesting to

consider how this assignment could be extended:

• More realism would be achieved if we could render the shadows of objects onto other

surfaces. How could this be done?

• Here, a simple texture mapping procedure is used where the texture images are sampled

to the nearest pixel. You may (or may not) see some aliasing. How could the texture

mapping be improved to deal with this?

• What other types of surfaces could be added to this framework? Consider for example,

cones, torii, etc.

• Similarly, how could could one of the wireframe modelled objects be placed into the

scene?


http://www.daixie0.com/siteserver/cms/background_contentView.aspx?PublishmentSystemID=2&NodeID=9&ID=4073&ReturnUrl=background_content.aspx_question_PublishmentSystemID_equals_2_and_NodeID_equals_9_and_DateFrom_equals__and_SearchType_equals__and_Keyword_equals__and_page_equals_1


版权所有:留学生编程辅导网 2020 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp