狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线

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

標簽:

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

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風(fēng)景名勝區(qū)
    昆明西山國家級風(fēng)景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • NBA直播 短信驗證碼平臺 幣安官網(wǎng)下載 歐冠直播 WPS下載

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    狠狠综合久久久久综合网址-a毛片网站-欧美啊v在线观看-中文字幕久久熟女人妻av免费-无码av一区二区三区不卡-亚洲综合av色婷婷五月蜜臀-夜夜操天天摸-a级在线免费观看-三上悠亚91-国产丰满乱子伦无码专区-视频一区中文字幕-黑人大战欲求不满人妻-精品亚洲国产成人蜜臀av-男人你懂得-97超碰人人爽-五月丁香六月综合缴情在线
  • <dl id="akume"></dl>
  • <noscript id="akume"><object id="akume"></object></noscript>
  • <nav id="akume"><dl id="akume"></dl></nav>
  • <rt id="akume"></rt>
    <dl id="akume"><acronym id="akume"></acronym></dl><dl id="akume"><xmp id="akume"></xmp></dl>
    美女网站色免费| 欧美一级欧美一级| 国产精品视频一区二区三区四区五区| 欧美一级黄色录像片| 国产5g成人5g天天爽| 日韩欧美国产片| 看一级黄色录像| 91成人综合网| 日韩精品 欧美| 久久综合久久色| 免费看涩涩视频| 国产亚洲视频一区| 蜜臀av无码一区二区三区| 日韩中文字幕在线不卡| 国产深夜男女无套内射| 九九热视频免费| 久草精品在线播放| 成人免费a级片| 簧片在线免费看| 全黄性性激高免费视频| 日韩av中文字幕第一页| 成人免费观看毛片| 亚洲无在线观看| 国产freexxxx性播放麻豆| 国产精品沙发午睡系列| 公共露出暴露狂另类av| 韩日视频在线观看| www.99在线| 日韩a∨精品日韩在线观看| 国产一区二区三区精彩视频| gai在线观看免费高清| 欧洲精品视频在线| 欧美在线观看成人| 国产欧美精品一二三| 一女被多男玩喷潮视频| 国产一级片自拍| 黄色一级视频片| 国产麻豆电影在线观看| 邪恶网站在线观看| 国产主播自拍av| av中文字幕网址| 国产在线青青草| 一本大道东京热无码aⅴ| 爱情岛论坛成人| 怡红院av亚洲一区二区三区h| 福利视频999| 9久久婷婷国产综合精品性色| 日本香蕉视频在线观看| 亚洲欧美手机在线| 欧美日韩在线免费播放| 无码 制服 丝袜 国产 另类| www激情五月| jizzzz日本| 蜜臀av午夜一区二区三区 | 青青青青草视频| 久久久久久久久久一区| 污污视频网站免费观看| 日韩欧美一区二| 我的公把我弄高潮了视频| 992tv成人免费观看| 污视频网站观看| 九色porny自拍| 免费黄色一级网站| 亚洲福利精品视频| 韩国一区二区av| 日本激情视频在线| 日韩av播放器| 国产精品人人妻人人爽人人牛| 国产97在线 | 亚洲| 免费看又黄又无码的网站| 日韩 欧美 视频| 国产欧美日韩网站| 1024精品视频| 在线观看国产中文字幕| 尤物国产在线观看| 欧美aaa在线观看| 国产一级大片免费看| 欧美人成在线观看| 激情五月开心婷婷| 男女视频在线看| 日韩精品第1页| 男人天堂a在线| www.国产区| 91小视频在线播放| 天堂а√在线中文在线| www.浪潮av.com| mm131亚洲精品| 国产美女作爱全过程免费视频| 国产原创中文在线观看| 在线观看免费成人av| 欧美精品一区二区性色a+v| r级无码视频在线观看| 免费看黄色一级大片| 国产免费一区二区三区四在线播放| 久久男人资源站| 在线黄色免费观看| 欧美中日韩在线| 久久久精品高清| 极品美女扒开粉嫩小泬| 亚洲va综合va国产va中文| 国产黄色激情视频| 国产精品区在线| 日韩中文字幕在线视频观看| 岛国av免费在线| 无码少妇一区二区三区芒果| 久久久国产精华液999999| 久久男人资源站| 91香蕉视频导航| 欧美精品久久久久久久免费| 国产精品中文久久久久久| 国产肥臀一区二区福利视频| 偷拍盗摄高潮叫床对白清晰| 成人免费毛片播放| 午夜免费福利小电影| 亚洲国产欧美91| 日本激情视频在线播放| av之家在线观看| 男人添女荫道口女人有什么感觉| 欧美女同在线观看| 黄色一级免费大片| 免费男同深夜夜行网站| www插插插无码视频网站| 日韩video| 精品国产三级a∨在线| 在线免费看污网站| 美女喷白浆视频| 激情网站五月天| av黄色在线网站| 黄色免费视频大全| 亚洲国产精品久久久久婷蜜芽| 日韩成人三级视频| 久久亚洲国产成人精品无码区| 一级黄色免费在线观看| 亚洲第一成肉网| 吴梦梦av在线| 日本aa在线观看| 久久手机在线视频| av日韩一区二区三区| www.国产在线播放| 国产又黄又大又粗视频| 欧洲黄色一级视频| 2025韩国理伦片在线观看| 尤蜜粉嫩av国产一区二区三区| 天堂社区在线视频| jizz18女人| 欧美日韩dvd| 成人在线免费观看av| 国产精品天天av精麻传媒| 看欧美ab黄色大片视频免费| 久热精品在线播放| 久久免费视频2| 日本欧美视频在线观看| 激情视频综合网| 99热一区二区三区| 999在线观看视频| 日本成人中文字幕在线| 五月天婷婷在线观看视频| 国内外成人激情免费视频| 国产素人在线观看| 天天操狠狠操夜夜操| 一级黄色片播放| 国产无套粉嫩白浆内谢的出处| 午夜久久久精品| 国产av人人夜夜澡人人爽麻豆| 男人揉女人奶房视频60分| 中文字幕成人免费视频| 精品久久久无码人妻字幂| 成年人网站大全| 91黄色在线看| 日本黄大片一区二区三区| 成人网站免费观看入口| 国产精品久久久久久久av福利| 2018国产在线| 日本美女爱爱视频| 777视频在线| av天堂永久资源网| 久久久无码中文字幕久...| 久久撸在线视频| 免费在线观看的av网站| 国产大尺度在线观看| 国产免费视频传媒| 91免费黄视频| 国产成人亚洲综合无码| 亚洲怡红院在线| 中文久久久久久| 国产成人综合一区| 欧美成人三级在线视频| 好吊色这里只有精品| 国产视频1区2区3区| 日韩精品一区中文字幕| 亚洲午夜精品久久久久久人妖| 亚洲小视频在线播放| 波多野结衣免费观看| 不卡的av中文字幕| 超碰在线播放91| 午夜久久福利视频| 岛国av免费在线| 亚洲国产精品影视| 日韩精品aaa| 熟女熟妇伦久久影院毛片一区二区|