• 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
Question by Bossounet34090 · Jun 30, 2014 at 11:22 AM · texturemeshuv coordinates

Apply a texture on model 3D with the Mouse Position taking account of the scale/position/rotation of uv // Appliquer une texture sur un modele 3D en fonction de la position du curseur en prenant en compte la rotation/taille/position des uv

Hello

Let me explain the project (all on runtime)

I want to create an application to show a model 3D imported in runtime (rotate around and zoom) and being able to print a logo/texture imported(with transparency) on the mesh with the mouse position to reexport the whole

I created a projector to preview the texture on the mesh (rotate with the hit.point and the hit.normal) To print, i take the hit.textureCoord and apply the texture around it (texture.width/2 etc...) with getPixel/setPixel (not pixelS because it doesn't apply the alpha on the pixel and print black pixel)

BUT : problem

The UV map is unknown (it's user's model), so the rotation, scale and position of areas are unknown (ex for box's UV, we can do it like a cross, or a T or explode ... )

The projector must show what it will be printing (scale/rotation/alpha) on runtime when i click, it must print my logo on the texture (actual or a new) taking account of all parameters of model

How can i adapt the projector and the print to make what i want?

Thanks for help :) Have a good day

sorry for my bad english

/////////////////////// /////////////////////// /////////////////////// ///////////////////////

Bonjour

Petite explication du projet pour mieu comprendre (tout est en temps réel)

Je veux créer une application pour visualiser un modèle 3D importé en temps réel (avec possibilité de tourner autour et zoomer) et pouvoir tamponner un logo ou une texture importé également (avec la transparence) sur le mesh en fonction de la position de la souris pour ensuite exporter le tout

J'ai créé un projecteur pour avoir un aperçu de la texture sur le mesh (orienté avec le hit.point et le hit.normal) Pour le tampon, je prend le hit.textureCoord et j'applique la texture autour de lui (comme si c'etait le centre donc je prend la moitié a gauche, la moitié en haut etc...) avec GetPixel/SetPixel (pas SetPixels parce qu'il n'appliquait pas la transparence, il appliquait des pixels noirs)

Mais problème les UV du modele sont inconnus (le modèle a été créé par l'utilisateur), donc la rotation la taille la position des différentes zones sont inconnus (exemple pour un cube, on peut deplier les UV comme une croix, ou comme un T ou en 3x2 ..) Le projecteur doit montrer ce qui sera tamponné (avec rotation/taille/transparence) en temps réel Quand je clique, l'apply doit tamponner mon logo sur la texture (l'actuelle ou une nouvelle) en prenant en compte tous les paremetres du modele (orientation et taille des uv )

Comment je peux adapter le projecteur et le tampon pour que ça corresponde a mes attentes?

Merci de votre aide :) Bonne journée

Comment
srmojuze

People who like this

1 Show 1
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 Bossounet34090 · Jul 02, 2014 at 02:02 PM 0
Share

Finally, th eproblem is : how to print a logo on the mesh with the good uv coordinates? if i'm on the uv corner, i must to recover the good coordinates

Finnalement le probleme est : comment tamponner un logo sur le mesh avec les bonnes coordonnées ? si je suis sur le bord des uv, je dois récupérer les bonnes coordonnées

0 Replies

· Add your reply
  • Sort: 

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

How to get uvCordinat of raycast hit without mesh collider 1 Answer

Texture2D.PackTextures Uv problem 0 Answers

Transparency problems with a mesh 2 Answers

How do I texture this voxel cube? 1 Answer

How do I blend multiple textures on a mesh? 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