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

Material on Plane? #137

Closed
ghost opened this issue Mar 18, 2011 · 1 comment
Closed

Material on Plane? #137

ghost opened this issue Mar 18, 2011 · 1 comment
Labels

Comments

@ghost
Copy link

ghost commented Mar 18, 2011

can this work? I've tried it but material doesn't seems to load?

var material = new THREE.MeshBasicMaterial( { map: ImageUtils.loadTexture( './images/abc.jpg' ) } );

var plane = new THREE.Mesh( new Plane( 200, 200 ), material);
plane.material = material;
plane.position.x = Math.random() * 2000 - 1000;
plane.position.y = Math.random() * 2000 - 1000;
plane.position.z = Math.random() * 2000 - 1000;
plane.overdraw = true;
plane.doubleSided = true;
scene.addObject( plane );

@mrdoob
Copy link
Owner

mrdoob commented Mar 18, 2011

Why are you doing plane.material = material;?

Anyway, it should work, yes. Make sure it's not a problem of localhost (disable local file access). Try it online somehow.

@mrdoob mrdoob closed this as completed Mar 23, 2011
greggman pushed a commit to greggman/three.js that referenced this issue Nov 5, 2021
greggman pushed a commit to greggman/three.js that referenced this issue Nov 9, 2021
greggman pushed a commit to greggman/three.js that referenced this issue Nov 9, 2021
greggman added a commit to greggman/three.js that referenced this issue Nov 24, 2021
* add translation kr/threejs-billboards.md

* add translation kr/threejs-cleanup.md

* add translation kr/threejs-voxel-geometry.md

* add translation kr/threejs-game.md

* r115 to r119

* Create threejs-optimize-lots-of-objects-animated.md

* add ja translation with orginal script

* delete orginal english scripts

* brush up  translation

* commit to merge master

* Create threejs-primitives.md

* fix version references

* fix script link

* update translations r115 to r119

* Create threejs-offscreencanvas.md

* use lesson-builder v1.7.0

* Update threejs-offscreencanvas.md

* lint

* prefer object spread

* add translation kr/threejs-material-table.md

* add translation kr/threejs-debugging-javascript.md

* add translation kr/threejs-debugging-glsl

* add translation kr/threejs-tips.md

* fix paths

* Update langinfo.hanson

* reword

* fix example threejs-prerequisites.md

* fix prereq example

* doc: translate wip

* doc: translate wip

* doc: translated the responsive page

* fix: toc and correct sentense

* fix: chapter title

* fix: toc of prerequisites

* doc: translated setup patge

* debug

* remove superfluous slashes

* add lang link refs

* fix voxel diagram

* update morphtargets-w-colors for r119

* typos

* adjust to match article

* fix typo

* fix out-of-date issue

* doc: new ja file

* doc: translate ja of rendering on demand

* doc: translate complete of rendering on demand

* translate ja of scenegraph

* Japanese translation of debugging javascript (mrdoob#125)

* doc: translate debugging javascript

* Translatioin ja materials (mrdoob#126)

* translate ja of materials

* Japanese translation of debugging GLSL (mrdoob#127)

* doc: translate ja of debugging glsl

* fix lut-loader

* add csp support to lut-reader

* test files

* fix blank png in firefox issue

* Feature/materials ja 002 (mrdoob#130)

* fix technical term.

* doc: translate ja of threejs tips (mrdoob#131)

* Typo (mrdoob#132)

* doc: fix translate toc of tips

* doc: translate ja of optimize lots of objects

* translate ja of texture

* Japanese translation of optimize lots of objects animated (mrdoob#135)

* doc: translate ja of optimize lots of objects animated

* fix moonOrbit diagram/code

* flip v

* Japanese translation of offscreencanvas (mrdoob#136)

* doc: translate ja of offscreencanvas

* doc: translate ja of offscreencanvas completed

* Fix typo in threejs-scenegraph (mrdoob#137)

* use width, height 100%

* fix for safari

* typo

* typo

* Japanese translation of load obj (mrdoob#139)

* doc: translate ja of load obj completed

* add the “threejs_center”div and related image

test the *

* update the chinese threejsfundamentals article

* doc: translate ja of load gltf

* update threejs-prerequisites.md: "onload" not "onbody"

minor typo

* bump to r122

* doc: translate ja of backgrounds

* doc: translate ja of transparency

* minor typo fixes: "it's" to "its"

* minor typo fix: "whether are not"

* use github actions

* pre-build

* run

* Japanese translation of picking (mrdoob#148)

* doc: translate ja of picking

* Japanese translation of multiple scenes (mrdoob#149)

* doc: translate ja of multiple scenes

* doc: translate ja of post processing

* Japanese translation of post processing 3dlut (mrdoob#151)

* doc: translate ja of post processing 3dlut

* Update zh_cn translation (mrdoob#152)

* Fix link error in ja/threejs-post-processing.md

* update zh_cn translation

Co-authored-by: Evan <liuzhenqiang@ecityos.com>

* throw up

* Translate primitives to zh_cn (mrdoob#153)

* Fix link error in ja/threejs-post-processing.md

* translate primitives to zh_cn

Co-authored-by: Evan <liuzhenqiang@ecityos.com>

* fix:  シリーズ -> 連載

* doc: translate ja of lights(wip)

* doc: translate ja of lights

* contributors

* fix NODE_ENV

* doc: translate ja of cameras(wip)

* doc: translate ja of cameras

* fix:  コーン -> 円錐体

* add chinese font family

Change-Id: I0820dbe78552ddf50dde776ea19b207ef3a7ecaf

* threejs-fundamentals translation optimize

Change-Id: I5598f8cb2e4db305dc3448d748373d32fb5f9465

* run on pull-request but don't deploy

* typo

* Revert "threejs-fundamentals translation optimize"

This reverts commit e75392bdb5e9aa4bac808c9ee969541b126e3440.

* improve threejs-responsive translation

Change-Id: Id0c68fc92137cdccfae87f30b79741a9dfc9ebfb

* fix links at build time instead of run time

* Revert "Revert "threejs-fundamentals translation optimize""

This reverts commit 3b1c480b971c6c43dcc4354b1e73de61f6cf0375.

It might work after the fix?

* cleanup

* debug

* fix zh_cn links

* fix zh_cn links

* Japanese translation of shadows (mrdoob#161)

* doc: translate ja of shadows

* Fix typo (mrdoob#162)

Co-authored-by: Torsten Knauf <Torsten.Knauf@maibornwolff.de>

* Improve diff of code snippet example (mrdoob#163)

Co-authored-by: Torsten Knauf <Torsten.Knauf@maibornwolff.de>

* typo

* typo

* typo

* Japanese translation of fog (mrdoob#164)

* doc: translate ja of fog

* translate scenegraph to zh_cn

* fix:typo in three-scenegraph on zh_cn

* add: translate threejs-materials to zh_cn

* translate threejs-textures to zh-cn

* bump deps

* test

* fix: Japanese translation of shadertoy

* Japanese translation of render targets

* Japanese translation of custom geometry

* fix vertexColors setting since r114 😅

* fix: Japanese translation of align html elements to 3d

* Japanese translation on Custom Buffer Geometry (mrdoob#177)

* translation on custom buffer geometry

* fix three-load-obj.md to use OBJLoader because three.js is removing OBJLoader2

* add warnings for translations that need update

* minor edits

* before translation

* head lines

* intro

* fix

* done translation on custom buffer geometry

* start billboard

* fix

* Docs: Change 'req' to 'res' for fetch handler

* fix: Japanese translation of canvas textures

* fix: Japanese translation of indexed textures

* translate threejs lights to zh-cn

* remove XXXBufferGeometry

* remove references to XXXBufferGeometry

* Change all XXXBufferGeometry to XXXGeometry

* remove custom-geometry from toc

* add note about r125 to geometry

* changed references to custom-geometry to custom-buffergeometry

* fix invert reference r122->r123

* bump to three r125.2

* more Geometry/BufferGeometry cleanup

* use pointer events for indexed-textures

* use pointer events for game

* voxel to pointer events

* remove references to geometry

* add warning for custom-buffergeometry translations

* add translation warnings with links

* add referecnes for translations

* add referecnes for translations

* add referecnes for translations

* translate 4 chapters: cameras; 2optimize; rendering on demand

* r122 -> r125

* fix links

* edit

* fix: update latest

* cleanup

* remove stackoverflow q? links

* feat:post-processing -> cn

* has been deprecated

* debugging-glsl -> cn

* fix: keep `world matrix`

* update kr/langinfo.hanson

* Create threejs-shadows.md

threejs-shadows tranlated by zh-cn

* remove call to helper.update

* words

* fix as OrbitControls switched to using pointer events

* add index.md

* add langinfo

* add toc

* fix translation

* add fundamentals translation

* add more translation in fundamentals

* fix missing

* warning

* remove double reference

* fix typo on text geometry primitive

* Update threejs-fundamentals.md

Typo

* Update threejs-textures.md

Typo

* Update threejs-lights.md

Typo

* add Chinese version of the chapter Fog

* Delete contributors.md

* Create contributors.md

* add Chinese version of chapter rendertargets

* add Chinese version of the chapter custom-buffergeometry

* add link to discussions

* [threejs-backgrounds.md]: fix 'scene.background = rt.texture'

* Fix: threejs-background-equirectangularmap.html 'scene.background = rt.texture'

* bump three to r127

* stat.js

* stats

* typo

* Fix a repeating bug in lession threejs-optimize-lots-of-objects-animated

* Fix typo in lesson ( code >> cone ).

* Fix typo if -> it

* fix grammatical errors

* fix grammatical errors

* fix grammatical errors

* add French translation

* add French translation

* add French translation

* add French translation

* add French translation

* add French Translation

* add French translation

* add French translation

* add French translation

* translate the TOC in french

* fix some errors in translation

* fix some translation errors

* some changes to improve the translation

* Improve translation : change three by Three & canevas by canvas

* Translate TOC in french

* Improve translation: change installation to configuration

* translate TOC in french

* translate the description in French

* fix grammatical errors

* fix grammatical errors

* add French translation

* add French translation

* add French translation

* add French translation

* add French translation

* add French Translation

* init

* update

* add French translation

* turn off antialiasing on texture diagrams

* bumpthree

* updates for r132

* bump to r132

* add  translation for  threejs-picking in zh_cn

* remove physically based lights from fake shadows example

* fix for r132

* fix offscreen orbitcontrols

* README

* README

* fix closingTag error in three-primitives on zh_cn

* move and delete in prep for merge with three.js

* Integrate the threejsfundamentals articles into three's repo

Notes:

* organization

  ```
  manual
   +-en
   | +-article1.html
   | +-article2.html
   | +-...etc...
   +-ja
   | +-article1.html
   | +-article2.html
   | +-...etc...
   +-...
   +-3rdparty
   | +-monaco-editor
   +-resources (images etc for the articles)
   +-examples (the html files for each working example)
     +-example1.html
     +-example2.html
     +-resources (the image etc for examples)
  ```

* the articles use a special version of `prettify.js` in `manual/resources/prettify.js`

  This version of prettify checks the first character of each line where '+' = line added,
  '-' line deleted, '*' line changed. I bring this up just if you want to use some other
  colorizer for code it will need to handle that.

* manual/3rdparty/monaco-editor is the text editor used for live editing
  It's large and maybe you'd like to serve it from CDN?

* the live editor export and three versions

  The live editor has an export button to jsfiddle/codepen/codesandbox/stackoverflow.
  On threejsfundamenals.org all samples were pegs to a specific version and
  [all versions stayed available](https://github.com/gfxfundamentals/threejsfundamentals/tree/master/threejs/resources/threejs).
.
  This way if a user exports an example it keeps working because it
  links to the version that worked at the time of export.

  In this version the examples all reference `build/three.module.js` and when exported
  those links are converted to skypack.dev links at the current version. The current version
  is determined by fetching `https://raw.githubusercontent.com/mrdoob/three.js/master/package.json`.
  If there is a better way to get the version you can update `/manual/examples/resources/editor-settings.js`.
  Like, if you want exports to link to `https://threejs.org/build/three.modules.js` then just edit
  `/manual/examples/resources/editor-settings.js` and make `fixJSForCodeSite` just return its input.
  (eg: `function fixJSForCodeSite(url) { return url; }`).
  When exported they reference `https://threejs.org/build/three.module.js` whichs means
  when three updates their exported stuff will break.

* Path hacks

  The examples contain valid non qualified links. For example `import * as THREE from '../../build/three.module.js'`.
  In order to actually run the samples in the editor without a server side component the samples are loaded via fetch
  and the inserted into a blob. No URLs are relative to blobs so the URLs need to converted to fully qualified.
  In other words,  `import * as THREE from '../../build/three.module.js'` needs to become
  `import * as THREE from 'https://threejs.org/build/three.module.js'`.

  The process to do this is a bunch of hacky regular expressions in `/manual/examples/resources/editor-settings.js`
  in `fixSourceLinks`. The "proper" way would require a full HTML parser and JavaScript parser which is way too much
  code but, using regular experssions is brittle.

  If you look at the expressions you can see it's searching for things like `<script src="??">`, `<img src="???">`,
  `import bla '???'` and for three.js it's also searching for `loader.load` in various forms.

  The point is, if you add a new sample you need to write it in a way that these expression will find your non qualified links
  and fix them for you or add new expression. For things like `loader.load('some/unqualified/path')` it works but if
  it's `loader.load(someVariable)` then it won't work.

  The solution I chose you can put `/* threejs.org: url */` at the end of a line. This expression looks for the last quoted string
  on the line and assumes it's a link. Example

  ```
  const images = [
    { name: 'dog', path: 'some/unqualified/path/husky.jpg', }  /* threejs.org: url */
    { name: 'cat', path: 'some/unqualified/path/siamese.jpg', }  /* threejs.org: url */
    { name: 'bat', path: 'some/unqualified/path/vampire.jpg', }  /* threejs.org: url */
  ];
  for (const {name, path} of images) {
    loader.load(path);
    ...
  ```

  Now the script will convert these paths when loading them into the editor. The comment will be stripped so the user's
  does not see it in the editor.

* Known Article Issues

  * optimize-lots-of-objects-animated was broken by r134.

    The point of the article was to show how to use morph targets to animate a 1000 cubes like the webgl-globe
    and fix a long standing bug in the webgl-globe that it doesn't animate the colors of the cubes.
    It just uses colors of the first set of cubes values which means it shows the wrong represtation of everything
    but the first set.

    With the new way morph targets work it looks like it's very non trivial to add vertex color morph targets.
    If there is still an easy way to do it I'm happy to update the aritcle
    but as it is, you should probably just delete it.

  * align-html-elements-to-3d was written before I knew about `CSS2DRender`

    I've never had time to re-write it and I thought explaining the math might be useful. It's up to you
    whether or not you want to keep it.

  * all the samples use rAF directly

    I'm guessing you'd prefer `setAnimationLoop` at this point

  * all of the samples follow the advice of the `responsive.html` article

    This means they all assume the user used CSS to set the size of the canvas.
    They always pass `false` as the 3rd parameter to `Renderer.setSize`

Co-authored-by: SeemsPyo <eunsatio@gmail.com>
Co-authored-by: vanzo16 <vanzo16@ya.ru>
Co-authored-by: tasotasoso <nayuta.suzuki@gmail.com>
Co-authored-by: naotaro0123 <n.ikewada@gmail.com>
Co-authored-by: Theo Avoyne <tavoyne@gmail.com>
Co-authored-by: mell0kat <katherine.mello@wework.com>
Co-authored-by: xiaodong <18945084806@163.com>
Co-authored-by: nbogie <neillbogie@googlemail.com>
Co-authored-by: Evan <awesomeyggd@gmail.com>
Co-authored-by: Evan <liuzhenqiang@ecityos.com>
Co-authored-by: wangtianqi <wangtianqi.timi@bytedance.com>
Co-authored-by: shaman-apprentice <Torsten.Knauf@gmx.de>
Co-authored-by: Torsten Knauf <Torsten.Knauf@maibornwolff.de>
Co-authored-by: ehhong <ehhong21@gmail.com>
Co-authored-by: yui <yuikita21@gmail.com>
Co-authored-by: Yui Kita <arcoyk@users.noreply.github.com>
Co-authored-by: puxiao <yangpuxiao@gmail.com>
Co-authored-by: DBingo <dbqwjxh529@163.com>
Co-authored-by: Roy Kid <lijichen365@126.com>
Co-authored-by: magic-zhu <18817313320@163.com>
Co-authored-by: Allvirus <gbvaq@foxmail.com>
Co-authored-by: cengizcmataraci <cengizcmataraci@gmail.com>
Co-authored-by: giorgioporgio <georgekets@hotmail.com>
Co-authored-by: Vee Jay <46869937+Veejayspb@users.noreply.github.com>
Co-authored-by: HuangYu <1090165925@qq.com>
Co-authored-by: Tony <tony@maapps.dev>
Co-authored-by: Halu89 <63454314+Halu89@users.noreply.github.com>
Co-authored-by: Labnan <55809005+Labnann@users.noreply.github.com>
Co-authored-by: mickceb <cebulski.mi@gmail.com>
Co-authored-by: YangLei <xcchcaptain@126.com>
Co-authored-by: Zachary_M <yuihjk015328@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant