精品深夜AV无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕

代做COMP27112、代寫Java語言程序

時間:2024-03-08  來源:  作者: 我要糾錯



Introduction to Visual Computing
Coursework Assignment 2
Sun, Planet and Moon
Tim Morris
Introduction
The aim of this exercise is to render a simple solar system with one moon orbiting one
planet orbiting one sun. As with the previous exercise, you’ll need a web browser to display
the output and a simple text editor1 to create the html file you’ll need.
This piece of work contributes half of the coursework assessment. We suggest that you
should not spend more than 15 hours in total completing Assignments 1 and 2.
Getting Started
Start off with the same code as last time for creating the basic webpage. Under “// Your
Javascript will go here.” you’ll add any global variables and calls to two
functions, init() and animate().
Creating the Scene (init();)
Everything is initialised in this function.
As before, add a scene, camera and renderer and add the renderer to the
document (don’t forget to declare the scene, camera and renderer as global
variables). You won’t need a vertex shader or fragment shader this time.
Put the far plane of the camera at 10000. Locate the camera at (0, 30, 500) and add it to the
scene.
You’ll need to create nine variables for the sun’s, earth’s and moon’s geometries, materials
and meshes. These are global variables.
You can create the sun object using the following code:
1 You should ensure that your text editor saves your html files as plain text. Some editors (e.g. TextEdit on the
Mac add all kinds of stuff to what you think is a plain html file, meaning that you just see the text of your file
when you open it in your browser. Don’t forget to give your files the correct extension.
You could also use a suitable IDE.
sunGeometry = new THREE.SphereGeometry(109, 400, 200);
sunMaterial = new THREE.MeshStandardMaterial(
 {
 emissive: 0xffd700,
// emissiveMap: texture,
 emissiveIntensity: 1,
 wireframe: false
 }
);
sunMesh = new THREE.Mesh(sunGeometry, sunMaterial);
scene.add(sunMesh);
This creates a spherical object (what do the arguments mean?) of a particular colour. Where
is it located? The emissiveMap is something you may use later.
The sun must be a source of light. The PointLight() constructor can achieve this.
Create a point light source of white light at the origin and add it to the scene. You might also
add a diffuse light to give some background illumination, use AmbientLight().
Obviously this is physically unrealistic but it makes the objects more visible.
You can create the earth and moon using similar code with the following differences:
• The earth sphere geometry arguments are 25, 50, 50
• The moon sphere geometry arguments are 5, 40, 20
• Both the earth and moon materials are MeshPhongMaterial, they don’t have an
emissive argument, but do have a color. You can experiment with color
values.
The texture argument might be used later. So the earthMaterial can be created
using something like:
earthMaterial = new THREE.MeshPhongMaterial(
 {
// map: texture,
 color: x0000ff
 }
The earth and moon will be grouped together into one object before being added to the
scene. To do this we need a global variable to store the earth-moon system, we need to
add the earth to it, by default it will go to the origin of this system. Then we need to add the
moon to the system and set its position relative to the earth.
Three.js provides a group object for storing collections:
earthSystem = new THREE.Group();
Then the earth (and moon) can be added to this in a manner that was similar to the way we
added the sun to the scene:
earthSystem.Add(earthMesh);
Don’t forget to set the position of the moon within the earth-moon system, using a function
something like:
moonMesh.position.set(orbitRadius, 0, 0);
A suitable value for orbitRadius is in the range 40 – 60.
The earth’s orbit could be approximated as a circle, and the location of the earth on it could
be computed as the following pseudocode:
earth.position.x = earthOrbitRadius * sin(2pwt);
earth.position.y = earthOrbitRadius * cos(2pwt);
w is the earth’s angular velocity and t is some measurement of time.
It is slightly more realistic to make the orbit an ellipse. To make this more efficient we precompute the co-ordinates of the earth’s orbit. Create a global variable with a suitable name.
The points can be computed by calling the function EllipseCurve. This has arguments
to define:
• The x co-ordinate of the centre point of the ellipse
• The y co-ordinate of the centre point of the ellipse
• The radius of the ellipse in the x direction
• The radius of the ellipse in the y direction
• The start angle for drawing the ellipse (in this case 0 radians)
• The end angle for drawing the ellipse (in this case 2p radians)
• Plus other arguments that can take default values.
You may choose to draw the orbit, in which case you will have to
• Transfer points from the orbit into a line buffer
• Create a geometry (using BufferGeometry) from these points
• Create a material (using LineBasicMaterial) and setting a suitable colour
• Create a line object using the geometry and material
• Rotate the line so it lies in the XZ plane instead of the default XY plane
• Add it to the scene
Animation (Animate();)
The basic animation function will contain the two lines to render the scene and request an
animation frame, as in the previous exercise. If you’ve followed the instructions so far and
now implement this, you’ll see a static scene with the sun, earth and moon in fixed positions
and the earth orbit (if you chose to draw it). The earth and moon should be solid coloured
spheres. The next step is to add movement to the objects. The following code should be
added to Animate() before the two lines you’ve just written.
The sun’s movement is simple. It doesn’t move. You might want to make it rotate if you add
a texture to it, which will be done later.
The earth-moon system’s position could be driven by using a counter that is incremented
for each frame of the animation. But we’ll use the time instead. A time can be obtained by
calling performance.now(). This gives the time in milliseconds since the browser
window was opened. This can be converted into a value in the range [0, 1) which will be
used as an index into the values of the EllipseCurve you defined earlier. In
pseudocode:
time = 0.00001 * performance.now();
t = (time mod 1)
We can get the earth-moon position by reading a point from the EllipseCurve object
(assume it’s called curve):
point = curve.getPoint(t)
Then the earthSystem’s x and z positions can be set to point.x and point.y
respectively. Changing the value of the multiplier (0.00001) will change the earth’s orbital
speed.
The moon’s position is set according to
moon.x = orbitRadius*cos(time*speed)
moon.z = orbitRadius*sin(time*speed)
Time was derived above. Speed is the orbital speed of the moon – you choose a sensible
value.
Optional Enhancements
Some optional enhancements follow.
Changing the viewpoint
It is possible to change the observer’s viewpoint by adding the following controls.
Insert the following line after the other import statement.
import { OrbitControls } from
"https://web.cs.manchester.ac.uk/three/three.jsmaster/examples/jsm/controls/OrbitControls.js";
Add a global variable with a suitable name, possibly controls.
Add the following two lines to the init() function:
controls = new OrbitControls(camera, renderer.domElement);
controls.autoRotate = true;
These add a controller to the scene and allow you to move the viewpoint by clicking and
dragging.
Texturing
The sun, earth and moon can be textured using textures from
https://www.solarsystemscope.com/textures/download/2k_sun.jpg
https://upload.wikimedia.org/wikipedia/commons/a/ac/Earthmap1000x500.jpg
https://svs.gsfc.nasa.gov/vis/a000000/a004700/a004720/lroc_color_poles_1k.jpg
To read these you’ll have to create one texture loader
const loader = new THREE.TextureLoader();
Textures can be loaded using this
var texture = loader.load(‘filename’); OR
var texture = loader.load(‘URL’);
And added to the material of the object you’re creating, by uncommenting the line in the
example above where you created the sun object.
The earth and moon textures can be added similarly, except you’ll add the line
map: texture,
to the material constructor. You’ll also need to delete the color property.
The problem you may encounter when attempting to run the code is that the resource fails
to load, and you have an error message such as
Access to image at <source> from origin 'null' has been blocked by CORS policy
This is a security feature of most modern browsers. You can set up a server on your host to
overcome this problem. Instructions are widely available on the web, specifically here
https://threejs.org/docs/index.html#manual/en/introduction/How-to-run-things-locally
If you’re using Chrome you can alternatively install an extension that allows CORS cross
origin loading (https://chrome.google.com/webstore/detail/allow-cors-accesscontrol/lhobafahddgcelffkeicbaginigeejlf?hl=en). Or in Safari you can explicitly turn off the
CORS checking.
Rotations
You can make the sun, Earth and Moon rotate on their axes, much like the cube rotated in
the previous exercise. Make sure you choose an appropriate length of the “day”.
Clouds
You could add clouds to the Earth. Find a cloud image (e.g.
https://i.stack.imgur.com/B3c7G.jpg) and add it as a transparent texture to a sphere mesh
that is slightly larger than the Earth. Make it rotate slightly slower than the Earth.
Background
You can also create a starry background for the scene. Make a very large sphere mesh – to
make sure it’s big enough to contain everything. Add a texture image of the Milky Way:
https://cdn.eso.org/images/screen/eso0932a.jpg
Make the sphere visible from inside as well as outside by setting the side member of the
material to THREE.DoubleSide.
Submission
Once you have a working solution, capture a short video of your solution, no more than 15
seconds long. It must demonstrate all the properties of your solar system, and not so
quickly that the marker can’t see them clearly (you’ll be penalised for videos that have so
much zooming or camera movement that it’s impossible to see the earth or moon rotating).
ZIP this and your html and submit the file to the Lab 2 area in Blackboard.
Submissions that are not in the ZIP format will not be marked.
Marking Scheme
We will endeavour to mark your work in face-to-face sessions in the scheduled labs.
You will receive marks for:
• The objects being in appropriate locations and moving appropriately.
請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:SCC312代做、代寫Java編程語言
  • 下一篇:代寫CSC8208、Java/c++編程語言代做
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    精品深夜AV无码一区二区_伊人久久无码中文字幕_午夜无码伦费影视在线观看_伊人久久无码精品中文字幕
    <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
    <ul id="e4iaa"></ul>
    <blockquote id="e4iaa"><tfoot id="e4iaa"></tfoot></blockquote>
    • <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp>
      <ul id="e4iaa"></ul>
      <samp id="e4iaa"><tbody id="e4iaa"></tbody></samp><ul id="e4iaa"></ul>
      <ul id="e4iaa"></ul>
      <th id="e4iaa"><menu id="e4iaa"></menu></th>
      91久久久久久久久久久久| a级黄色片免费看| 好吊视频一区二区三区| 精品熟女一区二区三区| 一区二区三区少妇| 日韩免费视频一区二区视频在线观看| 国产欧美一区二区三区在线观看视频 | 精品久久久中文字幕人妻| 少妇一区二区三区四区| 久草视频手机在线| 国产一区二区三区四区视频 | 人妻少妇无码精品视频区| 精品成人久久久| 国产三级国产精品国产专区50| av大片免费在线观看| 亚洲国产综合久久| 亚洲一区二区三区四区av| 亚洲天堂久久久久| 成年人小视频在线观看| 国产免费视频一区二区三区| 国产99在线 | 亚洲| 亚洲国产成人va在线观看麻豆| 天天爽夜夜爽视频| 伊人色综合久久久| 亚洲欧美国产高清va在线播放| 97香蕉碰碰人妻国产欧美| www男人的天堂| 国产中文字幕免费| 日本国产在线观看| 亚洲 欧美 视频| 亚洲综合123| 国产精品玖玖玖| 激情久久综合网| 日韩一级片免费| 亚洲图片综合网| 国产精品自拍99| 精品人妻伦九区久久aaa片| 欧美日韩在线观看成人| 熟妇人妻一区二区三区四区| 亚洲 小说区 图片区| 亚洲乱妇老熟女爽到高潮的片| www.久久久久久久久久| 久久久久久久亚洲| 婷婷激情五月网| 丰满少妇高潮在线观看| 蜜桃91麻豆精品一二三区| 樱花草www在线| 精品成人av一区二区三区| 日韩一区免费视频| 一本一道精品欧美中文字幕| 国产女人18毛片水真多| 免费国产黄色片| 亚洲综合久久av一区二区三区| 精品成人久久久| 中文字幕狠狠干| 久久久久久久蜜桃| 97香蕉碰碰人妻国产欧美| 欧美极品jizzhd欧美18| 一级aaaa毛片| 欧美一区二区三区成人精品 | 婷婷社区五月天| 国产69精品久久久久久久久久| 欧美一区二区激情视频| 一级黄色片在线免费观看| 久久国产在线视频| 亚洲一区二区蜜桃| 特级做a爱片免费69| 国产又大又黄的视频| 一级特黄aaa大片| 日韩精品视频一区二区| 国产超碰人人模人人爽人人添| 少妇伦子伦精品无吗| 国产又粗又猛大又黄又爽| 正在播放亚洲精品| 欧美日韩在线视频播放| 国产精品久久久久久久久久久久久久久久久 | 黄色av片三级三级三级免费看| 久久久久久久黄色| 亚洲色图 在线视频| 久久老司机精品视频| 亚洲这里只有精品| 香蕉久久久久久久| 人妻av无码一区二区三区| 国产美女福利视频| 插我舔内射18免费视频| 亚洲国产一二三区| 天天操天天摸天天爽| 免费a级黄色片| 精品一区二区6| 国产视频91在线| 成人免费一区二区三区| 亚洲精品www.| 亚洲不卡的av| 五月婷婷综合久久| 天天看天天摸天天操| 欧美成人精品欧美一级乱黄| 国产人妻大战黑人20p| 丰满熟女人妻一区二区三| 91美女精品网站| 亚洲天堂小视频| 91精品国产三级| 97人妻精品一区二区三区免| 亚洲午夜精品一区| 91国模少妇一区二区三区| 亚洲综合婷婷久久| 91片黄在线观看喷潮| www.亚洲欧美| 国产视频不卡在线| 久久精品女人毛片国产| 久久精品无码专区| 久久精品视频在线观看免费| 国产一级久久久| 久草视频免费在线播放| 久久久久久久久久97| 老熟妇高潮一区二区高清视频| 欧美 中文字幕| 色一情一乱一区二区三区| 我不卡一区二区| 亚洲天堂视频在线| 国产精品23p| 久久久久99精品成人片试看 | www.激情五月.com| 动漫av一区二区三区| 国产性一乱一性一伧一色| 久久精品色妇熟妇丰满人妻| 日韩精品一区二区亚洲av性色 | 人妻激情偷乱视频一区二区三区| 欧美性猛交xxxx乱| 中国免费黄色片| 丰满熟女一区二区三区| 国产永久免费网站| 色窝窝无码一区二区三区成人网站 | 亚洲爆乳无码一区二区三区| 天天干天天操av| 亚洲免费看av| 国产视频123区| 人人干人人视频| 天堂成人在线视频| 天天干天天色天天干| 亚洲国产精品久久人人爱潘金莲| www.av88| 日韩欧美亚洲国产| 999在线免费视频| 精品国产一级片| 天天久久综合网| 国产精品久免费的黄网站| 日本一级免费视频| 成人小视频在线播放| 欧美三级 欧美一级| 亚洲精品一区二区三区不卡| 国产精品视频免费播放| 人人妻人人澡人人爽精品日本| 91精品人妻一区二区三区蜜桃欧美 | 中文字幕一区二区人妻在线不卡 | 日本理论中文字幕| 亚洲图片小说视频| 久久黄色小视频| 一本一道人人妻人人妻αv| 久久久久久久久久久久久女过产乱 | 亚洲综合一区中| 久久久久久久亚洲| 中文字幕在线日亚洲9| 国产在线观看你懂的| 日韩欧美亚洲另类| 国产免费美女视频| 亚洲精品视频91| 欧美熟妇另类久久久久久多毛| 亚洲一区二区三区蜜桃| 日韩av综合在线| 国产手机在线视频| 91在线公开视频| 亚洲av无码精品一区二区| 久久人人爽人人爽人人| 国产 日韩 欧美 综合| 一区二区不卡免费视频| 嫩草av久久伊人妇女超级a| 草久视频在线观看| 亚洲精品国产熟女久久久| 日本中文字幕免费在线观看| 国产免费999| а 天堂 在线| 亚洲欧美一区二区三区不卡| 天天操天天操天天干| 久久综合桃花网| 国产熟妇一区二区三区四区| 亚洲一区在线观| 在线播放国产一区| 婷婷激情四射网| 天天干天天色天天干| 日本少妇久久久| 欧美一级淫片免费视频黄| 久久久久99精品| 久久久久久久极品内射| 国产免费www| 国产精品情侣呻吟对白视频| 91成人在线观看喷潮蘑菇| 亚洲人成人无码网www国产| 中文字幕天堂av| 亚洲精品国产久| 亚洲区一区二区三|