We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

# Parametric Objects

Home Forums Programming Parametric Objects

Viewing 4 posts - 1 through 4 (of 4 total)
• Author
Posts
• #3477
jem
Customer

Hi,
I am investigating the possibility of dynamically scaling objects. The Verge3D API supports single and multi-axis scaling. The code is simple. Scaling might be a good solution for simple parametric objects.

Parametric Object Scene

This technique works well for basic materials. It does not work well for materials that require UV maps. I have provided a link to a simple example that you can play with. You can make the objects larger or smaller by clicking on the arrows. You can see that this technique works well for the top blue cube but the lower cube has problems. On the lower cube, the material begins to distort as the length changes. I believe that the distortion happens because of the vertices in UV map do not change as the object changes size. This is not surprising.

I considered writing a function using the API that would dynamically update the object’s UV array but I recognize that: #1 this is too difficult for me and #2 this solution would only work for very simple shapes under very simple conditions. So, I did not attempt to do this.

Does anyone in the community have ideas how this could be done well? I would love the feedback.
Thanks,
Jem.

Jeremy Wernick

#3492

Hi, Jem. Look at THIS EXAMPLE we made for you. May be this will be useful. Also attached a working example. You can control mixing of the textures with the value inside the material.

###### Attachments:
You must be logged in to view attached files.

Co-founder and lead graphics specialist at Soft8Soft.

#3505
jem
Customer

Hello Mikhail,
Thank you very much for this amazing example. I am still trying to understand everything that you did in your example. I am not very good with the shader node system but I will work hard to learn.

In your example, I see that the material is mapped with the global coordinate system rather than the object’s local coordinate system. That is very smart. I also see that you are using the object’s normals to set the rotational transformations for the material to the object’s other faces. This is where I get lost, but I will try to understand it.

Thank you!
-Jem

Jeremy Wernick

#3510

In your example, I see that the material is mapped with the global coordinate system rather than the object’s local coordinate system. That is very smart. I also see that you are using the object’s normals to set the rotational transformations for the material to the object’s other faces. This is where I get lost, but I will try to understand it.

Textures place on the object using global coords as you mentioned but normals directions used as b/w masks to separate one texture from another so they placed each from they own side. Math node used just to shift this mask a little (add math node) or make them sharper or more smooth (multiply math node).

Co-founder and lead graphics specialist at Soft8Soft.

Viewing 4 posts - 1 through 4 (of 4 total)
• You must be logged in to reply to this topic.