Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 neosca · Feb 22, 2017 at 09:17 AM · scaleruntimegrid based gamedynamicallydynamic mesh

How to create a cube in 2d view and scale it based on a point/anchor? Than visualize the cube in 3d.

I want to create a cube/wall in 2d view and change its scale from one side based on a pivot or anchor, after that see the cube in 3d view.

Here is a youtube link/example of what I want to achieve: https://www.youtube.com/watch?v=53bWbujdBl8

basically taking a room shape and manipulate its scale than view in 3d. The live demo is available here: https://visualizer.somanyceramics.com/

Comment
Add comment · Show 2
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
avatar image K_Tec · Feb 23, 2017 at 07:36 PM 0
Share

Hello,

in my opinion, you could do two thinks:

you could write a very difficult Auto$$anonymous$$esh .dll wich cut the $$anonymous$$esh there were it overlapped and should be clamped.

or you make it with the two variables- like you wrote: you could try somethink like this:

 public float maxdeformation; //max. deformation
 public float $$anonymous$$deformation;// $$anonymous$$ deformation
 public float defor$$anonymous$$g; // this is the current deformation high- you must convert the polgons 
 count to a float 
 
 
 void Update(){
 if(deformation > maxdeformation) {
 
 //here comes your code wich increase the deformation
 
 
 
 
 
 
      }
 
 
 else{
 
 
 //here comes your code if the deformation is to small
 
 
 
 }
 
 else if(defor$$anonymous$$g<$$anonymous$$defor$$anonymous$$g){
 
 //here comes your code wich decrease the deformation
 
 
 
 }
 
 }


im not sure - maybe this works.

I hope i could help you,

12t

avatar image K_Tec · Feb 23, 2017 at 07:37 PM 0
Share

I will download this code- will try to do this and send it back to you :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by K_Tec · Feb 22, 2017 at 01:52 PM

Do you mean inside the Editor? Inside the Editor you could use the rect Transform. https://docs.unity3d.com/ScriptReference/RectTransform.html

if you mean in runtime you could write a script with set the Camera state to Orthographic than to Perspective. Thats Mesh derform, wich is difficult in Unity- but possible.

Comment
Add comment · Show 2 · 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
avatar image neosca · Feb 23, 2017 at 07:19 AM 0
Share

I took your suggestion and tried $$anonymous$$esh Deformation. I am now able to achieve the effect upto a certain extent. I am attaching the script I used for this(change the extension to '.cs' after downloading) .

The FULL TUTORIAL YOU CAN FIND HERE: https://www.youtube.com/watch?v=c-pqEHR1jnw Tutorial by matt...

link text

cubemeshdeformation.txt (8.5 kB)
avatar image neosca · Feb 23, 2017 at 07:34 AM 0
Share

However, there is another issue I am facing now. When I deform the mesh(cube in my case). It is very extreme. I want to limit the deformation to clamp between two values.

Here is a youtube link describing the issue.

https://youtu.be/hztNOUDXlkE

I am also attaching screenshots. The second image explains my issue.alt text

snip-20170223125950.jpg (166.6 kB)
second.jpg (140.1 kB)

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.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I load 3d models(.obj, .fbx) dynamically in to unity scene after building it to WebGL ? 1 Answer

Keeping textures unstretched even as a gameobject scale is changed 1 Answer

How expensive is scaling in 2D unity? Is it better to pre-scale? 1 Answer

Scaling in Runtime 2 Answers

Building a NavMesh at Runtime 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges