亚洲十八**毛片_亚洲综合影院_五月天精品一区二区三区_久久久噜噜噜久久中文字幕色伊伊 _欧美岛国在线观看_久久国产精品毛片_欧美va在线观看_成人黄网大全在线观看_日韩精品一区二区三区中文_亚洲一二三四区不卡

代做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

    久久九九影视网| 国产精品毛片久久久久久久| 天天综合色天天| 伊人网在线观看| 99久久婷婷国产综合精品首页 | 亚洲欧洲成人av每日更新| 精品日本一线二线三线不卡| 污污视频在线看| 9191国语精品高清在线| 欧美国产一区二区在线观看| 男人插曲女人视频免费| 69堂免费精品视频在线播放| 性一交一乱一区二区洋洋av| 亚洲一区二区偷拍精品| 色猫av在线| 久操成人av| 国产欧美精品在线观看| 福利电影导航| 亚洲日韩欧美一区二区在线| 成人av在线播放网址| 日韩视频一区二区在线观看| 手机在线理论片| 亚洲激情午夜| 粉嫩av一区二区三区免费野| 成码无人av片在线观看网站| 女人天堂亚洲aⅴ在线观看| 亚洲色图视频免费播放| 成人在线二区| 亚洲国产一成人久久精品| 一区二区三区产品免费精品久久75| 极品美乳网红视频免费在线观看| 奇米亚洲欧美| 亚洲男同性恋视频| jizz日韩| 悠悠资源网久久精品| 色呦呦一区二区三区| 欧美极品videos大乳护士| 日本sm残虐另类| 日韩精品在线网站| 日韩精品中文字幕吗一区二区| 懂色中文一区二区在线播放| 91精品久久久久久9s密挑| 国产日产精品_国产精品毛片| 亚洲欧美另类久久久精品2019| 婷婷激情在线| 久久美女性网| 精品成人私密视频| 精品在线网站观看| 亚洲激情男女视频| 丁香花在线高清完整版视频 | 亚洲精品一二三| 污污的网站在线免费观看| 麻豆一区二区在线| 国产一级电影网| 日韩精品91| 在线观看亚洲专区| 国产精品亚洲四区在线观看| 久久久久久久网| 免费在线观看av| 日韩电影在线观看网站| 国产视频三区| 午夜精品毛片| 在线观看91av| 亚州精品视频| 午夜国产不卡在线观看视频| 日韩免费小视频| 国产亚洲综合av| 天堂亚洲精品| aaa亚洲精品| 精品美女在线观看视频在线观看| 美女高潮久久久| 天天av综合网| 日本不卡123| 国产一二三在线观看| 日韩成人免费在线| 在线观看高清av| 亚洲欧美日韩综合国产aⅴ| 男男视频在线观看网站| 在线中文字幕亚洲| 精品成人佐山爱一区二区| 91精品国产自产在线观看永久∴| 欧美日韩国产一级| 精品一区二区三| 欧美一区二区三区色| 欧美色婷婷久久99精品红桃| 欧美美女bb生活片| 欧洲激情综合| 精品欧美一区二区久久| 亚洲一级毛片| 国产精品久久久久永久免费看| 亚洲特级毛片| 最全影音av资源中文字幕在线| 天堂久久一区二区三区| 最全影音av资源中文字幕在线| 日韩av电影免费观看高清完整版| 久热av在线| 狠狠色狠狠色综合系列| mm1313亚洲国产精品美女| 91在线视频播放地址| 亚洲最大成人| 一区二区三区四区在线播放 | 91成人精品观看| 亚洲va天堂va国产va久| 欧美亚洲色图校园春色| 欧美一区二区三区在线观看| 伊人精品成人久久综合软件| 视频二区在线| 黑丝一区二区| 欧美午夜一区二区三区免费大片| 精品一区免费| 精品国产1区二区| 先锋亚洲精品| 最新国产在线观看| 国产三级精品三级在线专区| 成人网ww555视频免费看| 午夜婷婷国产麻豆精品| 精品盗摄女厕tp美女嘘嘘| h七七www色午夜日本| 蜜臀av性久久久久蜜臀aⅴ四虎| 成人影欧美片| 1024成人网色www| 亚洲成aⅴ人片久久青草影院| 天天舔天天干| 狠狠色综合日日| 国模一区二区| 这里只有精品免费| 久久精品人人做人人爽电影蜜月| 久久五月精品| 中文字幕日韩一区| 成人网18入口| 欧美性xxx| 欧美丝袜自拍制服另类| 黄色综合网站| 成人看av片| 亚洲福利视频三区| 欧美顶级大胆免费视频| 男人av在线| 亚洲精品亚洲人成人网在线播放| 九九久久精品| 国产专区在线| 亚洲精品午夜久久久| 99热在线成人| 日本视频在线| 狠狠久久亚洲欧美专区| 亚洲一区中文| 成人香蕉视频| 日韩欧美在线一区二区三区| 精东粉嫩av免费一区二区三区 | 国产精品美女久久久久久| 免费精品国产的网站免费观看| 在线看的网站你懂| 中文字幕一区二区三区不卡在线| 国产欧美日韩免费观看| 黄色小视频在线免费观看| 伊人一区二区三区| 伊人久久成人| 在线一区av| 天天撸夜夜操| 国产三级一区二区| 66久久国产| 丁香花在线电影| 日韩午夜激情视频| 99久久国产综合色|国产精品| 西野翔中文久久精品国产| 韩日视频在线| 色一区在线观看| 国产精品99久久久久久宅男| 粉嫩精品导航导航| аⅴ资源新版在线天堂| 在线视频中文字幕一区二区| 国产伦精品一区二区三区在线观看| 国产精品午夜av| av大片在线看| 欧美日韩国产三级| 99久久免费精品高清特色大片| 青青草国产成人a∨下载安卓| 日本乱理伦在线| 2019天天操夜夜操| 国产精品青草综合久久久久99| 欧美日韩精品免费观看视频完整| 小h片在线观看| 狠狠操夜夜操| 亚洲www啪成人一区二区麻豆| 青青青伊人色综合久久| 成人精品毛片| 在线午夜影院| 日本成人免费网站| 亚洲国产精品视频| 日韩成人av影视| 亚洲第一福利专区| japanese色国产在线看视频| 四虎影视av| 欧美日韩国产页| 国产成人免费在线观看不卡| 97精品一区| 99热这里有精品| 国产网友自拍视频导航网站在线观看 | 狠狠88综合久久久久综合网| 成人影院网站ww555久久精品| 北岛玲日韩精品一区二区三区|