Now I want to have a material like here:
https://threejs.org/examples/#webgl_materials_envmaps_exr
So I would add the following:
* {
margin: 0;
padding: 0;
}
.object {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
pointer-events: none;
background-color: rgb(200, 200, 200);
}
<script type="module">
import * as THREE from "https://threejs.org/build/three.module.js";
import { OBJLoader } from "https://threejs.org/examples/jsm/loaders/OBJLoader.js";
var container;
var camera, scene, renderer;
var mouseX = 0,
mouseY = 0;
var windowHalfX = window.innerWidth / 2;
var windowHalfY = window.innerHeight / 2;
var object;
init();
animate();
function init() {
container = document.createElement("div");
container.className = "object";
document.body.appendChild(container);
camera = new THREE.PerspectiveCamera(
45,
window.innerWidth / window.innerHeight,
1,
2000
);
camera.position.z = 250;
// scene
scene = new THREE.Scene();
var ambientLight = new THREE.AmbientLight(0xcccccc, 0.4);
scene.add(ambientLight);
var pointLight = new THREE.PointLight(0xffffff, 2);
pointLight.position.set(100, 100, 50);
camera.add(pointLight);
scene.add(camera);
// manager
function loadModel() {
object.traverse(function (child) {
//This allow us to check if the children is an instance of the Mesh constructor
if (child instanceof THREE.Mesh) {
child.material = new THREE.MeshStandardMaterial({
color: "#555",
roughness: 0.1,
metalness: 0.4
});
child.material.flatShading = false;
//Sometimes there are some vertex normals missing in the .obj files, ThreeJs will compute them
}
});
object.position.y = -90;
scene.add(object);
}
var manager = new THREE.LoadingManager(loadModel);
manager.onProgress = function (item, loaded, total) {
console.log(item, loaded, total);
};
// model
function onProgress(xhr) {
if (xhr.lengthComputable) {
var percentComplete = (xhr.loaded / xhr.total) * 100;
console.log("model " + Math.round(percentComplete, 2) + "% downloaded");
}
}
function onError() {}
var loader = new OBJLoader(manager);
loader.load(
"https://threejs.org/examples/models/obj/female02/female02.obj",
function (obj) {
object = obj;
},
onProgress,
onError
);
//
renderer = new THREE.WebGLRenderer({ alpha: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
container.appendChild(renderer.domElement);
document.addEventListener("mousemove", onDocumentMouseMove, false);
//
window.addEventListener("resize", onWindowResize, false);
}
function onWindowResize() {
windowHalfX = window.innerWidth / 2;
windowHalfY = window.innerHeight / 2;
camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
function onDocumentMouseMove(event) {
mouseX = (event.clientX - windowHalfX) / 2;
mouseY = (event.clientY - windowHalfY) / 2;
}
//
function animate() {
requestAnimationFrame(animate);
render();
}
function render() {
camera.position.x += (mouseX - camera.position.x) * 0.05;
camera.position.y += (-mouseY - camera.position.y) * 0.05;
camera.lookAt(scene.position);
renderer.render(scene, camera);
}
</script>
Unfortunately, it does not work. Why?
I would be very thankful if somebody could help me! 🙂
I have been exploring for a bit for any high-quality articles or blog
posts in this sort of house . Exploring in Yahoo I
eventually stumbled upon this site. Reading this information So i am happy to express that I
have an incredibly excellent uncanny feeling I came upon just what I needed.
I so much certainly will make certain to do not put out of your mind this web
site and give it a look regularly. http://herreramedical.org/azithromycin
cytotec cost at walmart
modafinil buy – modafinil online provigil a controlled substance
where can i buy cytotec in jeddah
accutane 20mg – cost of accutane in canada generic accutane price
order prednisone canada
amoxicillin on line – buy amoxicillin 500 mg amoxicillin for uti
where can i buy ivermectin – cost of stromectol buy stromectol pills
indianpharmacy com – tadalafil 2.5 mg price tadalafil 30mg pill
I have read so many articles or reviews regarding the blogger lovers except this
article is really a fastidious post, keep it up. http://antiibioticsland.com/Stromectol.htm
buy ivermectin – ivermectin 6mg ivermectin for cov 19
canada online pharmacy accutane – accutane 220mg accutane drug price
lyrica for sale online – legit canadian pharmacy online walgreens pharmacy
buy amoxicilin noscript – amoxicillin for sale for humans 500 mg generic name of amoxil
female viagra cheap – viagra online pfizer viagra online hong kong
buy tadalafil in mexico – tadalafil medication cost reputable online pharmacy no prescription
25 mg prednisone – prednisone online without a prescription prednisone for sale without a prescription
provigil 100mg – modafinil and birth control modafinil dosage
zithromax z pak 250 mg – zpac azithromycin tablets
clomid for sale – clomid generic where can i buy clomiphene
It’s really a nice and useful piece of information. I’m satisfied that you simply shared this useful information with us.
Please stay us up to date like this. Thanks for sharing. http://www.deinformedvoters.org/hydroxychloroquine
buy generic viagra online europe – sildenafil india pharmacy cheap viagra pills online
cheap ventolin australia
cialis 2019 – approved cialis cialis 80mg online
amoxicillin trihydrate capsules 500mg
ivermectin 250ml – ivermectin 5 mg ivermectin cost in usa
rx number for albuterol
betfair casino online – casino slots red dog casino
zithromax for tonsillitis
Today, I went to the beachfront with my children. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She put the shell to her ear and screamed.
There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this is entirely off topic but I had to tell someone! https://buszcentrum.com/clomid.htm
erectile dysfunction causes – over the counter ed pills at walgreens drugs for ed
deltasone generic – where can i buy prednisone 30mg prednisone
sildenafil 50mg united states – where can i buy viagra canada buy sildenafil uk
I like the helpful information you provide in your articles.
I will bookmark your weblog and check again here frequently.
I’m quite sure I will learn many new stuff
right here! Good luck for the next! http://hydroxychloroquined.online/
tadalafil uk paypal – Cialis no rx cheapest price for tadalafil
ivermectin generic cream – buy ivermectin canada ivermectin pills
lisinopril interstitial nephritis
ventolin inhaler – ventolin generic price ventolin generic brand
cytotec over the counter australia – cytotec price in india how much is cytotec tablet
doxycycline 7.5 mg – cheapest doxycycline uk doxycycline tablets
neurontin online usa – neurontin cap buy synthroid online
sildenafil 50mg uk – where do i get viagra
cialis for sale in india – tadalafil generic in usa
generic vardenafil coupon – buy vardenafil online europe buy cheap vardenafil no prescription
30-day cialis
isotretinoin 20 mg – cheap accutane prescription purchase accutane with paypal
buy amoxicilina 500 mg – amoxil 500 mg buy amoxicilin 500 mg from canada
Propecia usa
lasix 10 mg tablet price furosemide no prescription nek nox
buy viagra online cheap usa – stviag viagra pill otc
lasix 10 mg tablet price lasix over the counter cvs nek nox
buy lasix without a prescription over the counter lasix nek nox
Good way of describing, and nice article to take information on the topic of my presentation topic, which i am going to present in academy. https://tadalafili.com/
buy prednisone 5mg – prednisone online for sale how much is prednisone in canada
lasix 20 mg – clomid for sale furosemide 20 mg tablet cost
where to buy cytotec in johor bahru
where can i buy cytotec pills in south africa – buy cytotec canada cytotec pills price in south africa
where to buy clomid pills
100 doxycycline – best price for prescription doxycycline prednisolone 40 mg
ivermectin 1 cream – ivermectin 6mg online ivermectina online
clomid without script
ivermectin for covid – ivermectin 3 mg tabs ivermectin lotion cost
generic for sildenafil – sildenafil 20 mg sildenafil online prescription
tadalafil coupon – tadalafil generic online tadalafil online pharmacy
clomid 50 price nek nox
ivermectin 4 – stromectol usa ivermectin 6 mg tablets
brand viagra – Cialis online usa cialis 2017
cenforce 120mg – vidalista 20mg cenforce 25
orlistat medication reviews – xenical pill generic brand for xenical
ivermectin uk coronavirus – buy ivermectin purchase ivermectin
prescription cialis uk – how to buy cialis online pharmacy no presc uk
ivermectin pill cost – ivermectin pill cost stromectol buy uk
Greetings! I know this is kind of off topic but I was
wondering which blog platform are you using for this website?
I’m getting tired of WordPress because I’ve had issues with hackers and I’m looking at options for another platform.
I would be great if you could point me in the direction of a good platform. http://harmonyhomesltd.com/Ivermectinum-during-pregnancy.html
generic sildenafil for sale in canada – us viagra sales viagra 120mg otc
tadalafil online buy – Generic cialis cheap tadalafil fast delivery
ivermectine – buy ivermectin tablets ivermectin cost canada
academic writers online – affordable essay writing buy cheap essays online
generic viagra from india – Buy no rx viagra generic viagra price
prednisone drops after cataract surgery – cheap prednisone online prednisone 12 mg
sildenafil generic sildenafil cgmp
levitra online purchase levitra generique
essay valentine’s day roya essay
utm thesis manual 2011 clinton saul alinsky thesis
generique viagra – sildenafil 50mg pas cher acheter 10mg cialis en ligne
best price usa tadalafil cialis at canadian pharmacy
where to buy cialis without prescription https://nextadalafil.com/
tadalafil generic where to buy cialis cost
tadalafil dosage https://cialisvet.com/
viagra alternatives buy viagra new york
cialis sale tadalafil reviews
where to order tadalafil tablets side effects for tadalafil
ivermectin price order stromectol online
stromectol canada generic ivermectin
generic ivermectin 6 mg
stromectol 6 mg https://www.ivermectinoge.com/
stromectol 6mg stromectol without a doctor prescription buying ivermectin online
ivermectin tablets
cialis mg brand cialis blue sky peptides tadalafil