Reputation: 11930
Here's a demo of a rotating paper cup
https://jsfiddle.net/o5cd8g0h/
I want to increase the size of image in the cup, tried this
logoMesh.scale.x = 1.5;
logoMesh.scale.y = 1.5;
logoMesh.scale.z = 1.5;
logoMesh.position.set(0,-0.6,-0.6);
But the result is not what i expect https://jsfiddle.net/nL2spe5d/
Image gets placed incorrectly
How to increase size of logoMesh?
Upvotes: 1
Views: 229
Reputation: 17586
As I get it, it depends on logoFaceArray
. In simple words, it contains indices of faces. 6 faces on width, 8 faces on height.
Thus, if you want to make your logo mesh bigger, then you have to change this array of indices.
var logoFaceArray = [];
var multiplier = 2;
for(var lx = 0; lx < 6 * multiplier; lx++){
for(var ly = 0; ly < 8 * multiplier; ly++){
var index = 24 * lx + ly;
logoFaceArray.push(index);
}
}
Here you can play around with the multiplier
variable, or you can leave it equal to 1, but change the limits of lx
and ly
, but remember that they (lx
, ly
) have to be even numbers, else you'll get a saw edge at the bottom of the logo.
jsfiddle example
Upvotes: 1