• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by unity_RFEn2Ydihs3_BQ · Aug 17, 2020 at 08:35 PM · 3d model

Is it possible to scale one end of an object in all directions while keeping the other side the same?,Is it possible for a Cube to have one half scaled larger than the other half?

I am currently developing a 3D modelling program and one of the objects I am working with requires the ability to rescale the object on one end while keeping the other the same, and some objects may require scaling on both ends. If there is any possible way to do this within Unity and someone could answer this question or even provide a solution that would be much appreciated. To elaborate a bit more here is an image of what I mean. In the image on the left there is a cube where the front face is smaller than the back side of the cube and vice versa for the image on the right. If there is any solution at all please comment and left me know!alt text

,I am currently making a 3D modelling program for a company. I am trying to figure out how to scale the ends of the object I am working with. For this post, I will use the example of a cube. Something similar to this image, where one end is bigger than the other in all directions. If this is at all possible within Unity and someone could please provide me with a solution, that would be much appreciated! Thanks! alt text

capture.png (8.3 kB)
capture.png (8.3 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by highpockets · Aug 17, 2020 at 09:49 PM

You would have to access the vertices of the mesh of the MeshFilter component:

 Mesh mesh = GetComponent<MeshFilter>().mesh;
 Vector3[] verts = mesh.vertices;
 

There you have an array of the vertice positions of the mesh. Now you would have to find the vertices that you want to move which is somewhat of a difficult task, but once you know which verte you want to move, you would set the new positions while keeping them at the same indexes in the array copy and then you would have to set the mesh.vertices to your newly modified array.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

132 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Highlighting background triggered from a 3d model 0 Answers

How to paint on a 3D model and create a texture? 3 Answers

Scroll Paper or Carpet 2 Answers

3D model script for mesh and vertice deformatoin on mobile using touch and drag deformations by the user 1 Answer

best practices for importing and updating models 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges