Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop2 #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 30 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# mediaLab2

This lab aims to build your first Virtual reality (VR) app.

There are many open source alternatives to build virtual reality application. One of the web based solution is A-frame. You can try a live examples: https://aframe.io/aframe/examples/

# Requirements for repository
- You have to clone this repository and make two branches (master and develop).
- The develop branch should contain commits of every new feature of the VR application.
- When all features will be ready you have to merge the development branch to the master.

# Requirements for VR application
- You have to update A-frame version 0.6.0 to the newest with the point cloud plugin.
- There are two models provided in the task. Leave only one model and add matching background. If you do not like existing surroundings / models - customize as you like.
- Implement at least three features in the index.html like control panel to rotate, shift/move, zoom in/out, button to load object or any other function. Panel examples are available at: https://rdub80.github.io/aframe-gui/examples/all_components.html
- Test application on at least two browsers and specify in README.md which version and browser it was.
- Additional features are welcome and bonuses are available.
- To pass this lab, you have to complete at least two points from the requirement list.

# Important notes
- It might be the case, that web server will be need to run VR application.
- You can try to use Apache: https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md
- Tomcat: http://androidsrc.net/installing-tomcat8-raspberry-pi-3/
- HFS: http://www.rejetto.com/hfs/ or any other server.
# Narsykles

Veikia su narsyklemis:

Microsoft Edge
Firefox
# mediaLab2

This lab aims to build your first Virtual reality (VR) app.

There are many open source alternatives to build virtual reality application. One of the web based solution is A-frame. You can try a live examples: https://aframe.io/aframe/examples/

# Requirements for repository
- You have to clone this repository and make two branches (master and develop).
- The develop branch should contain commits of every new feature of the VR application.
- When all features will be ready you have to merge the development branch to the master.

# Requirements for VR application
- You have to update A-frame version 0.6.0 to the newest with the point cloud plugin.
- There are two models provided in the task. Leave only one model and add matching background. If you do not like existing surroundings / models - customize as you like.
- Implement at least three features in the index.html like control panel to rotate, shift/move, zoom in/out, button to load object or any other function. Panel examples are available at: https://rdub80.github.io/aframe-gui/examples/all_components.html
- Test application on at least two browsers and specify in README.md which version and browser it was.
- Additional features are welcome and bonuses are available.
- To pass this lab, you have to complete at least two points from the requirement list.

# Important notes
- It might be the case, that web server will be need to run VR application.
- You can try to use Apache: https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md
- Tomcat: http://androidsrc.net/installing-tomcat8-raspberry-pi-3/
- HFS: http://www.rejetto.com/hfs/ or any other server.
Binary file added aframe/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aframe/ground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
152 changes: 112 additions & 40 deletions aframe/index.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,112 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Lab2 - VR application</title>
<meta name="description" content="Basic example for Point Cloud component."></meta>
<script src="https://aframe.io/releases/0.6.0/aframe.min.js"></script>
<script src="js/aframe-pointcloud-component.js"></script>
</head>
<body>
<a-scene>
<a-assets>
<img id="groundTexture" src="https://cdn.aframe.io/a-painter/images/floor.jpg">
<img id="skyTexture" src="https://cdn.aframe.io/a-painter/images/sky.jpg">
</a-assets>

<a-plane src="#groundTexture" rotation="-90 0 0" height="100" width="100"></a-plane>
<a-light type="ambient" color="#445451"></a-light>
<a-light type="point" intensity="2" position="2 4 4"></a-light>
<a-sky height="2048" radius="30" src="#skyTexture" theta-length="90" width="2048"></a-sky>
<a-entity laser-controls line="color: red; opacity: 0.75"></a-entity>
<a-pointcloud
scale="0.1 0.1 0.1"
position="0 0.08 -2.5"
rotation="-90 45 0"
src="url(sculpt.ply)"
size="0.01">
</a-pointcloud>
<a-pointcloud
scale="0.5 0.5 0.5"
position="1.5 2 0.5"
src="url(Sphere.ply)"
size="0.05"
texture="url(VGTU-logo.png)"
depthWrite="false">
</a-pointcloud>

</a-scene>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Antras Laboratorinis</title>
<meta name="description" content="Basic example for Point Cloud component."></meta>
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>

<script src="js/aframe-pointcloud-component.js"></script>
<script src="https://rawgit.com/rdub80/aframe-gui/master/dist/aframe-gui.min.js"></script>
<script>

function rotate() {
var params = document.getElementsByTagName("a-pointcloud")[0].getAttribute("rotation");
var xRot = Number(params.x);
var yRot = Number(params.y) + 45;
var zRot = Number(params.z);
var rotation = xRot+" "+yRot+" "+zRot;
document.getElementsByTagName("a-pointcloud")[0].setAttribute("rotation", rotation);
}
</script>

</head>
<body>
<a-scene>
<a-assets>
<!-- <img id="groundTexture" src="https://cdn.aframe.io/a-painter/images/floor.jpg">
<img id="skyTexture" src="https://cdn.aframe.io/a-painter/images/sky.jpg"> -->
<img id="gradient" src="gradient.png">
<img id="ground" src="ground.png">
</a-assets>

<a-plane src="#ground" rotation="-90 0 0" height="100" width="100"></a-plane>
<a-light type="ambient" color="#445451"></a-light>
<a-light type="point" intensity="2" position="2 4 4"></a-light>
<a-sky height="2048" radius="30" src="#gradient" theta-length="90" width="2048"></a-sky>
<a-entity laser-controls line="color: red; opacity: 0.75"></a-entity>
<!-- <a-pointcloud
scale="0.1 0.1 0.1"
position="0 0.08 -2.5"
rotation="-90 45 0"
src="url(sculpt.ply)"
size="0.01">
</a-pointcloud> -->
<a-pointcloud
scale="0.5 0.5 0.5"
position="1.5 2 0.5"
src="url(Sphere.ply)"
size="0.05"
texture="url(VGTU-logo.png)"
depthWrite="false">
</a-pointcloud>

<a-gui-flex-container flex-direction="column" justify-content="center" align-items="normal" component-padding="0.1"
opacity="0.7" width="7" height="6" position="-6 2.5 -2" rotation="0 45 0">

<a-gui-radio
width="2.5" height="1"
onclick="testToggleAction"
value="Jungiklis1"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-radio>

<a-gui-button
width="2.5" height="0.75"
onclick="rotate()"
key-code="32"
value="Pasukti"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-button>

<a-gui-radio
width="2.5" height="0.75"
onclick="testToggleAction"
value="Jungiklis2"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-radio>

<a-gui-circle-timer
height="0.75"
count-down="5"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-circle-timer>

<a-gui-input
width="2.5" height="0.75"
onclick="testInputAction"
font-family="Arial"
value="Įveskite žodį"
>
</a-gui-input>

</a-gui-flex-container>
<!-- Camera + cursor. -->
<a-entity id="cameraRig" position="-3 2 3">
<a-camera look-controls wasd-controls position="0 0 0">
<a-gui-cursor id="cursor" raycaster="objects: [gui-interactable]" fuse="true" fuse-timeout="2000" design="dot">
</a-gui-cursor> <!-- /cursor -->
</a-camera> <!-- /camera -->
</a-entity>

</a-scene>
</body>
</html>
112 changes: 112 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Antras Laboratorinis</title>
<meta name="description" content="Basic example for Point Cloud component."></meta>
<script src="https://aframe.io/releases/0.8.2/aframe.min.js"></script>

<script src="js/aframe-pointcloud-component.js"></script>
<script src="https://rawgit.com/rdub80/aframe-gui/master/dist/aframe-gui.min.js"></script>
<script>

function rotate() {
var params = document.getElementsByTagName("a-pointcloud")[0].getAttribute("rotation");
var xRot = Number(params.x);
var yRot = Number(params.y) + 45;
var zRot = Number(params.z);
var rotation = xRot+" "+yRot+" "+zRot;
document.getElementsByTagName("a-pointcloud")[0].setAttribute("rotation", rotation);
}
</script>

</head>
<body>
<a-scene>
<a-assets>
<!-- <img id="groundTexture" src="https://cdn.aframe.io/a-painter/images/floor.jpg">
<img id="skyTexture" src="https://cdn.aframe.io/a-painter/images/sky.jpg"> -->
<img id="gradient" src="gradient.png">
<img id="ground" src="ground.png">
</a-assets>

<a-plane src="#ground" rotation="-90 0 0" height="100" width="100"></a-plane>
<a-light type="ambient" color="#445451"></a-light>
<a-light type="point" intensity="2" position="2 4 4"></a-light>
<a-sky height="2048" radius="30" src="#gradient" theta-length="90" width="2048"></a-sky>
<a-entity laser-controls line="color: red; opacity: 0.75"></a-entity>
<!-- <a-pointcloud
scale="0.1 0.1 0.1"
position="0 0.08 -2.5"
rotation="-90 45 0"
src="url(sculpt.ply)"
size="0.01">
</a-pointcloud> -->
<a-pointcloud
scale="0.5 0.5 0.5"
position="1.5 2 0.5"
src="url(Sphere.ply)"
size="0.05"
texture="url(VGTU-logo.png)"
depthWrite="false">
</a-pointcloud>

<a-gui-flex-container flex-direction="column" justify-content="center" align-items="normal" component-padding="0.1"
opacity="0.7" width="7" height="6" position="-6 2.5 -2" rotation="0 45 0">

<a-gui-radio
width="2.5" height="1"
onclick="testToggleAction"
value="Jungiklis1"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-radio>

<a-gui-button
width="2.5" height="0.75"
onclick="rotate()"
key-code="32"
value="Pasukti"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-button>

<a-gui-radio
width="2.5" height="0.75"
onclick="testToggleAction"
value="Jungiklis2"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-radio>

<a-gui-circle-timer
height="0.75"
count-down="5"
font-family="Arial"
margin="0 0 0.05 0"
>
</a-gui-circle-timer>

<a-gui-input
width="2.5" height="0.75"
onclick="testInputAction"
font-family="Arial"
value="Įveskite žodį"
>
</a-gui-input>

</a-gui-flex-container>
<!-- Camera + cursor. -->
<a-entity id="cameraRig" position="-3 2 3">
<a-camera look-controls wasd-controls position="0 0 0">
<a-gui-cursor id="cursor" raycaster="objects: [gui-interactable]" fuse="true" fuse-timeout="2000" design="dot">
</a-gui-cursor> <!-- /cursor -->
</a-camera> <!-- /camera -->
</a-entity>

</a-scene>
</body>
</html>