Easily code a virtual reality web experience with A-Frame (WebVR)

  Рет қаралды 55,266

freeCodeCamp.org

freeCodeCamp.org

6 жыл бұрын

With Mozilla's free framework A-Frame, anyone who can write HTML can create a virtual reality app, and anyone who knows JavaScript can animate the scene. In this video, Benji walks through an example, starting from scratch.
A-Frame:
aframe.io/
Code:
github.com/okaybenji/a-frame-...
Demo:
okaybenji.github.io/a-frame-d...
Thanks to Goldfire Studios for setting aside time for employees to work on their own projects.
goldfirestudios.com
You can follow Benji on Twitter @okaybenji
/ okaybenji
-
Learn to code for free and get a developer job: www.freecodecamp.com
Read hundreds of articles on programming: medium.freecodecamp.com

Пікірлер: 56
@brandonw.2066
@brandonw.2066 4 жыл бұрын
Just started looking into VR using js and this video is amazing.
@KhalidTubing
@KhalidTubing 2 жыл бұрын
Cool and Interesting, Glad to meet ya Benji! Khalid from Fes, Morocco.
@niphotwala188
@niphotwala188 6 жыл бұрын
Ok, This was awesome!
@maloriec351
@maloriec351 6 жыл бұрын
This is so cool! Thanks for sharing!
@jacobanderson10
@jacobanderson10 4 жыл бұрын
Thanks for the clear video
@crowdmaker
@crowdmaker 6 жыл бұрын
Killer video! I learned an incredible amount. I have one question for you - is there any particular reason you're using arrow notation to define functions like "shiftHue"? Is this now a JavaScript "design pattern"?
@okaybenji
@okaybenji 6 жыл бұрын
I don't think it's a design pattern, just personal preference. To me, it's cleaner and easier to read and results in fewer lines of code. But you do you!
@highcollector
@highcollector 6 жыл бұрын
Nowadays we use those fat arrows for functions, it's part of the new Javascript spec
@ricorobinson
@ricorobinson 6 жыл бұрын
This is awesome, I was waiting for an easy, intuïtive way to add VR to the web. Know any way to make it interactive? With gaze or something?
@ricorobinson
@ricorobinson 6 жыл бұрын
Benji Kay Perfect. Thanks!
@ellypotamianos
@ellypotamianos 6 жыл бұрын
I'm literate with computers, but I have not studied HTML. As an artist, I find this spectacular to animate designs on your own. Bringing a Surrealistic composition to life would be a dream of mine. I will look into your A-Frame when I have some time. My search that brings me to your video at this time is to find a way to post an HTML virtual exhibit to an HTML widget. It begins with "object" but requires "." Without changing the HTML code, I know that there is an HTML code sentence that one can implement prior to such an "object" HTML code, but I don't know it. It seems not too many people in IT at the website I'm trying to post know either. It would help tremendously if you knew.
@dondevivirtecnologiasparae8465
@dondevivirtecnologiasparae8465 5 жыл бұрын
Great work. Do you know how to use a IP camera (wifi camera) with webVR javascript and HTML5 (A-Frame, Three.js) .?. I'm looking for code examples to use an external camera for smartphone.
@aqibos
@aqibos 6 жыл бұрын
Big props for using native JS instead of including the jQuery library! Lol.
@BenjiJS
@BenjiJS 6 жыл бұрын
Haha XD thanks
@antoniofuller2331
@antoniofuller2331 2 жыл бұрын
LMAO
@arberstudio
@arberstudio 6 жыл бұрын
Can you import WebVR projects to be viewed in a native VR app? I can't find any info on this
@ankittiwari8079
@ankittiwari8079 5 жыл бұрын
Hey,buddy thanks for the tutorial but the ball and plane is not appearing on my computer screen.
@emmanuelogba434
@emmanuelogba434 6 жыл бұрын
Familiar with Aframe but didn't know you could make a sphere change color automatically, pretty cool.
@BenjiJS
@BenjiJS 6 жыл бұрын
Yeah, there are all sorts of things you can do, you're really just limited by your imagination. Animating by adjusting prop values is just one approach. You could also, for instance, change positions based on user input to create interaction. I'd recommend checking out the other examples on A-Frame's site if you're interested!
@emmanuelogba434
@emmanuelogba434 6 жыл бұрын
BenjiJS I will, it's been a while since I visited their site
@FahadAli-ot5kn
@FahadAli-ot5kn 4 жыл бұрын
Sir awasome project thanks for shareing
@inpace1
@inpace1 5 жыл бұрын
Thanks a lot ! :)
@geelemo
@geelemo 2 жыл бұрын
Is there any full course that goes in-depth into 3d animation with or without VR
@null_all_void
@null_all_void 5 жыл бұрын
Thanks!
@chadpalmer8643
@chadpalmer8643 5 жыл бұрын
Im a beginner, that texture did broaded horizons.
@Khangeldy
@Khangeldy 6 жыл бұрын
Cool thing !
@finetree1004
@finetree1004 4 жыл бұрын
thank you teacher
@gamer-tf2pe
@gamer-tf2pe 2 жыл бұрын
Thanks a lot
@adrishanish9626
@adrishanish9626 3 жыл бұрын
I am facing problem in playing it in mobile chrome browser, it says unable requests to browser to enjoy immersive mode
@studylicious9246
@studylicious9246 3 жыл бұрын
Sir, I have made a VR headset and it's hand controller. But I am so so so much confused that how can I make a game for it. Sir, can you please make a video over it? Whatever your answer may be, but please do reply sir
@srujanmhase2832
@srujanmhase2832 6 жыл бұрын
This is gold👌👍
@BenjiJS
@BenjiJS 6 жыл бұрын
Thanks, super glad you enjoyed it!!
@shanruan2524
@shanruan2524 3 жыл бұрын
Pure gold
@user-wo6gm2ut5v
@user-wo6gm2ut5v Жыл бұрын
how to put this vr scene into google cardboard?
@hussainsalih9736
@hussainsalih9736 5 жыл бұрын
Good
@mohamedfizerali2488
@mohamedfizerali2488 6 жыл бұрын
i using Windows, i used notepad for html, when i run in mozilla or chrome it shows nothing. in address tab it shiw the directory name,filename.html. it shows only blank, pls help fixing this issues
@BenjiJS
@BenjiJS 6 жыл бұрын
Sure, I can try to help. Could you upload your code somewhere I can take a look? (Github/Gist)?
@mohamedfizerali2488
@mohamedfizerali2488 6 жыл бұрын
i just coded script and a-scene. it is enough for single sphere view haa . am i right mate.
@BenjiJS
@BenjiJS 6 жыл бұрын
¯\_(ツ)_/¯ I'd have to see the code! You could also try copying the code from the Github repo in the description and see if it works for you.
@trankhanhhuynh2613
@trankhanhhuynh2613 6 жыл бұрын
I'd like to interject for a moment. Notepad is terrible. Use VS Code/Atom/Vim/Sublime Text instead, it is similar to Notepad but better. _I am using Atom_.
@trankhanhhuynh2613
@trankhanhhuynh2613 6 жыл бұрын
Can you give us your code?
@ChristopherWarrior
@ChristopherWarrior 4 жыл бұрын
I have an idea for a new VR project. Can I email you the idea? I need help building it and was hoping you could point me in the right direction.
@calebprenger3928
@calebprenger3928 6 жыл бұрын
What does math.sin do?
@BenjiJS
@BenjiJS 6 жыл бұрын
It's a sine wave function. It's commonly used as an easing function in coded animations. Can be used for instance to make things bob up and down. en.wikipedia.org/wiki/Sine_wave developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sin
@mendezfredy
@mendezfredy 6 жыл бұрын
a-frame link is wrong.
@freecodecamp
@freecodecamp 6 жыл бұрын
Fixed.
@louielouie9502
@louielouie9502 5 ай бұрын
Blue ball of wonder
@antoniofuller2331
@antoniofuller2331 2 жыл бұрын
Three.js is already easy enough, A-frane just makes autopilot LMAO
@galihridhoutomo
@galihridhoutomo 4 жыл бұрын
Sir, not work
@lukes.3227
@lukes.3227 6 жыл бұрын
Second Comment
@sarangs8441
@sarangs8441 6 жыл бұрын
First Comment
@okaybenji
@okaybenji 6 жыл бұрын
Sarang S y tho
@nathanhelmburger
@nathanhelmburger 2 жыл бұрын
Thanks!
@nathanhelmburger
@nathanhelmburger 2 жыл бұрын
I love doing little programmatic art projects in javascript with simple animated geometric figures, and I thought: "how awesome would it be if I could make a VR version of this? I wonder if that's easy to adapt from the regular javascript? I wonder if there's someone who made a tutorial video to show this?" Bam. Exactly what I was hoping for. Time to make some simple animated art, and risk making myself seasick with too many twirling spheres and cubes...
Top 10 CSS One Liners That Will Blow Your Mind
13:34
developedbyed
Рет қаралды 925 М.
Mom's Unique Approach to Teaching Kids Hygiene #shorts
00:16
Fabiosa Stories
Рет қаралды 10 МЛН
Русалка
01:00
История одного вокалиста
Рет қаралды 7 МЛН
Coding a Web Server in 25 Lines - Computerphile
17:49
Computerphile
Рет қаралды 329 М.
Designing a WebVR Game With A-Frame - Designer vs. Developer #18
7:15
Chrome for Developers
Рет қаралды 9 М.
A-frame vs Unity: Which is Best for Experiential Learning?
10:06
The VR Learning Designer
Рет қаралды 1,9 М.
FABIANO SACRIFICES 2 ROOKS AND WINS IN 9 MOVES!
6:07
Chess.com
Рет қаралды 389 М.
A-Frame, what's new and what's next with Diego Marcos
12:50
SFHTML5
Рет қаралды 2,3 М.
How I Coded An Entire Website Using ChatGPT
18:22
Nick White
Рет қаралды 1,8 МЛН
AR Over the Web Browser Using AR.js, A-Frame, & WebXR
49:32
CrossComm, Inc.
Рет қаралды 19 М.