由用户创建的信息 nivnoiman
14 September 2017 14:35
now my problem is ( after I merged the little faces to one face ) I get distorted image on the canvas.
![]()
and the original image is
![]()
this is my code
I'll tell you what I want to do.
In the end I want to create an object (ring).
Inside the ring (as in the experiments I try to do here) I want to have a text ( dynamic, that i could change it via js ).
something like this - link ( Ref )
![](https://content.screencast.com/users/NivNoiman/folders/Jing/media/64753e3f-fb20-4c78-beba-1e7a7172f7ad/2017-09-14_1430.png)
and the original image is
![](http://offerchef.co.il/wp-content/uploads/2015/12/%D7%A9%D7%A3-%D7%A4%D7%A8%D7%98%D7%99.png)
this is my code
img = new Image();
img.src = image_src;
img.onload = function() {
ctx_image.drawImage(img, 500, 500, ctx_image.canvas.width,
ctx_image.canvas.height);
ctx_image.fillStyle = "rgba(255,255,255,1)";
ctx_image.font = "250px Arial";
ctx_image.fillText( imageText , 300, 300); // 300 300
m_tex.update_canvas_ctx(cube, "Image");
}
I'll tell you what I want to do.
In the end I want to create an object (ring).
Inside the ring (as in the experiments I try to do here) I want to have a text ( dynamic, that i could change it via js ).
something like this - link ( Ref )
13 September 2017 13:45
How do I stretch the small blocks to the size of the whole block I marked ?
![]()
In the end I want the Image to be the size of the big block I marked.
![]()
At the moment it consists of filling small blocks.
* In your example the entire side of the cube is marked as material.
** In my scene ( the ring ) it consists of small cubes.
![](https://content.screencast.com/users/NivNoiman/folders/Jing/media/828ff98d-40df-4d70-862c-1b63ce557725/2017-09-13_1341.png)
In the end I want the Image to be the size of the big block I marked.
![](https://content.screencast.com/users/NivNoiman/folders/Jing/media/e21966de-6bc0-474b-8373-71d542bb681b/2017-09-13_1342.png)
At the moment it consists of filling small blocks.
* In your example the entire side of the cube is marked as material.
** In my scene ( the ring ) it consists of small cubes.
07 September 2017 12:35
Hi :)
This is my scene
https://www.screencast.com/t/bBbkhs9S8
I marked the place I want the text to appear.
This is my code
I want to place the text inside the red block ( in the screen shoot )
As you can see :
1. The text very small.
2. The text appear every block.
Thanks,
Niv.
This is my scene
https://www.screencast.com/t/bBbkhs9S8
I marked the place I want the text to appear.
This is my code
cube = m_scs.get_object_by_name("Cube");
ctx_image = m_tex.get_canvas_ctx(cube, "Image");
var inline_text = location.search.split('name=')[1];
if( inline_text !== undefined && inline_text.length ){
imageText = inline_text;
} else {
imageText = "Hello World";
}
if (ctx_image) {
img = new Image();
img.src = "image.jpg";
img.onload = function() {
ctx_image.drawImage(img, 0, 0, ctx_image.canvas.width,
ctx_image.canvas.height);
ctx_image.fillStyle = "rgba(255 ,255 ,255 ,1)";
ctx_image.font = "250px Arial";
ctx_image.fillText( imageText , 300, 300); // 300 300
m_tex.update_canvas_ctx(cube, "Image");
}
}
I want to place the text inside the red block ( in the screen shoot )
As you can see :
1. The text very small.
2. The text appear every block.
Thanks,
Niv.
06 September 2017 09:43
Hey Again :)
First - Thank you for the help.
I created the scene with the image and the text.
I wonder now, how can i change dynamic the text "Hello World" through JavaScript ?
When I tried to change it ( after the init function ) I got error "not defined"
even though I made the variable global.
Thanks,
Niv.
First - Thank you for the help.
I created the scene with the image and the text.
I wonder now, how can i change dynamic the text "Hello World" through JavaScript ?
When I tried to change it ( after the init function ) I got error "not defined"
even though I made the variable global.
Thanks,
Niv.
04 September 2017 08:04
03 September 2017 15:28