Don't know how to access ParametricGeometry in Three.js

I have tried to research how to access ParametricGeometry as I get this message every time I try to use it “THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js”

Any thoughts on how would be much appreciated.

You are obviously using an older template.

As the error message says, this geometry was moved from the core to the example directory. You can reach it with the given path.

This is similar to the text geometry.

In BeginnerExample you can see that at the beginning.

// step 0:  three.js project setup - (import modules), scene, camera, renderer, clock, light ...
 
import * as THREE from "https://threejs.org/build/three.module.js"; // imports only with <script type="module"> 
// Note: no THREE. in front of the name when using the modules!
import { OrbitControls } from "https://threejs.org/examples/jsm/controls/OrbitControls.js"; // for all steps
import { GLTFLoader } from "https://threejs.org/examples/jsm/loaders/GLTFLoader.js";		// to step 03
import { FontLoader } from 'https://threejs.org/examples/jsm/loaders/FontLoader.js';		// to step 11
import { TextGeometry } from 'https://threejs.org/examples/jsm/geometries/TextGeometry.js'; // to step 11

You can find the example in the collection .

Good luck. :slightly_smiling_face:

2 Likes

/cc

hofk:
About BeginnerExample (and I am a beginner) I see the graphic with the nice step-by-step increase in complexity. But I don’t know how to examine the code to learn how each step is implemented. Also, I’m having trouble navigating in the collection at:

Thanks for any help on this low-level question.

You get the source code of the examples in the browser under Windows by pressing Ctrl with U (in Apple Safari probably cmd alt U ).
You can also type or copy view-source: in front of the link.

In the collection you can see what it’s about by the pictures and the short title.

I enter Sphere, for example, in the browser search on the 2021 discourse.threejs.hofk.de page and get the highlights and can navigate from example to example.

2022-01-22 11.16.12 Firefox, Chrome is is similar

The best thing to do is to download the individual years and unzip the file on your computer. Then you have the html files in the folders and can open them with your favorite editor.

See link GetSources at the bottom of the page * discourse.threejs.hofk.de ,
and also the other references down there.

Good luck :slightly_smiling_face:

Many thanks for detailed answer!

hofk:
BeginnerExample is a great self-guided tutorial on many 3js features. In BeginnerExample you suggest the student try adding or modifying your original code. For my own study and experiment I downloaded the HTML file but, of course, this does not include external files such as the .png and .gltf ones.

If local use by downloading BeginnerExample is OK with you, where can I find the unresolved references?

Many thanks, Bob

Hello Bob,
you can download elements ( javascript, images, models?, videos) of a page. For my examples this is explicitly desired. It can also not be prevented so easily. There are inquiries about this, e.g. Best Practise: Hide 3D Models, so no one can download and reuse this models , How To Prevent Ripping

Go to the javascript of BeginnerExample.html . You will find in step 12
const dahliaTex = new THREE.TextureLoader().load( 'dahlia.png' ); // hofk, self photographed, free
Since no path is specified, the image is in the same folder as the javascript.

So you take the complete URL of the BeginnerExample.html

2022-03-06 10.31.39

and replaces BeginnerExample.html with dahlia.png.

2022-03-06 10.34.55

Click right and with the context menu you can store the image.


A bit more problematic with the models. I still have to come up with something. ??
Otherwise you can use your own models.

step 03:
loader.load( 'Lighthouse/Lighthouse_01.gltf', function ( gltf ) { // (CC-BY) Poly by Googl, contains lighting

Here the model is stored in the Lighthouse subfolder.

What you don’t see, there is another file Lighthouse_01.bin. Without it it does not work. Change to … .bin

2022-03-06 12.20.56
and enter.

Then you can store this file. Pache both files into the folder

2022-03-06 12.24.11

Problem! - Rope_001_SD has more files!


Video step 04:

HTML:

type
2022-03-06 12.26.01
and enter

You can store it with the context menu.

The subfolders with images and models are now enabled for access using a .htaccess file:
Options +Indexes

e.g.

This is now also given at the top of BeginnerExample.html

Thanks again for all the work you put in for this collection.
(insert sounds of applause and cheering from 3JS world who benefit from this.)
Bob