What can I use for modeling

Which programs can I use for 3d object modeling with Three js?
sketchup, blender what i know now. but exp can I model a bike realistically from start to finish and use it with the threeJs?
Can you make tutorials or resource suggestions related to this?

Hello,

i use blender 2.91.2 ( lot of tutorial on youtube i ve learnt like thank youtube ) , very easy to build object and it is better when there complex scene .

once you have done your object with blender you have to export it ( choose gltf2.0 to export and take care about option
include :select “selected Object”
transform : deselect “+Yup”
geometry : select “Apply modifier”
" UVS"
" Normals"
“vertex”

)

and after you have to import in your code like this
( you have to use GLTFLoader.js available in three package in folder Loader )

var bike ; 
const loaderBike = new THREE.GLTFLoader();

loaderBike.load( ‘glb/bike.glb’, function ( gltf ) {

bike = gltf.scene;

scene.add( bike);

}, undefined, function ( error ) {

console.error( error );

} );

1 Like

After if you need to use/move your object you need to call him like that

var myBike = scene.getObjectByName(‘bike’);

myBike.position.set(x,y,z);
myBike.applyQuaternion(q);
etc

the name bike in getObjectByName have to be set in blender .
in blender you can rename your object , and the name you give to your object in blender , is the name you use to get it in your code .

there is some limits when you export
see here glTF 2.0 — Blender Manual

and about texture in blender you have to use principled BSDF

1 Like

Hi,
thank you for all your answers

if you need to import several objet or for example if your bike is composed with different object you want to keep to animate after ( like you have front_wheel, rear_wheel,handle_bar, frame ect in blender )

you have to select all by press key A in blender ( hide camera and light before ) , export in gltf 2.0 in a file with name bike.glb , and when you have imported and added to scene they are structured like this

object with follow property
name :Scene
type : Group
children : [ ]
which have several children object with name given in blender , object you can get like this

var front_wheel=scene.getObjectByName(‘front_wheel’);
var rear_wheel=scene.getObjectByName(‘rear_wheel’);
var handle_bar=scene.getObjectByName(‘handle_bar’);
var frame=scene.getObjectByName(‘frame’);

etc

[quote=“Ali_USTUNEL1 Prepaid Gift Balance”]
Which programs can I use for 3d object modeling with Three js?
sketchup, blender what i know now. but exp can I model a bike realistically from start to finish and use it with the threeJs?
Can you make tutorials or resource suggestions related to this?
[/quote]

Blender can be a little bit more difficult to use, as you have to know exactly what you want to create while starting your project. SketchUp is more adapted to large or medium companies, while Blender is actually great for small teams or freelancers.