x


How to render 2D texture like a blob in real-time programmatically

Hello everybody ! Sorry for my bad english ;-) I have vertexes from polygon (i'm creating a polygon in real-time) and have an image (.png) 2D texture. How Can I Render this 2D image in this polygon ? Can anybody help me ? I want render 2D texture image for polygon like in this video http://www.youtube.com/watch?v=5WzGQQOIcp8

more ▼

asked Jun 15 '12 at 03:55 PM

Nano gravatar image

Nano
32 1 2 4

(comments are locked)
10|3000 characters needed characters left

5 answers: sort voted first

nice question ...

attention skinned mesh gurus, in fact could it just be done w/ a skinned mesh object ... something with a coupe of bones and a simple skin ???

To directly answer your question, you just have to learn how to build mesh on the fly, if that's really what you want to do. Start reading the Mesh doco in Unity.

more ▼

answered Jun 15 '12 at 09:29 PM

Fattie gravatar image

Fattie
20.1k 60 92 153

Thanks for your answer ! Can anybody give me some examples where I can with polygon points brush it with an image.png ? Do I need some algorithms like quad splitting for texture UV coordinates or smth. like that ? Please help me with this question, I dont know how to this, is there some scripts for this or smth. other resources ? I'm trying to do this with mesh, but I've mesh like a star but not a gish. I don't know how to do this with mesh. I've already read docs, tutorials, and many other articles. Thank You Very Much !

Jun 15 '12 at 10:01 PM Nano

"To directly answer your question, you just have to learn how to build mesh on the fly, if that's really what you want to do."

Unfortunately there is no easy way to do this.

To begin building mesh on the fly, create a cube in Unity. Attach a script to it. Learn how to get at the Mesh components, and then learn how to create new mesh arrays, then, figure out how to make the mesh from your new arrays.

All the info is here in basic form:

http://unity3d.com/support/documentation/ScriptReference/Mesh.html

BTW I doubt you could actually render in changing mesh that quickly, game engines don't like changing mesh shapes.

The game example you gave is NOT done in that way. You know?

Jun 16 '12 at 04:33 AM Fattie

Thanks for Your Answer Very Much ! Can you tell me please what way was done that game example ? http://www.youtube.com/watch?v=5WzGQQOIcp8

Jun 16 '12 at 08:04 AM Nano
(comments are locked)
10|3000 characters needed characters left

My some experiments on a cube are here TestMesh

I will research this domain till Master Level )))))))))

THANKS EVERYBODY for YOUR VERY NICE AND CONCRETE ANSWERS !!!

TestMesh.cs.zip (511 B)
more ▼

answered Jun 16 '12 at 12:03 PM

Nano gravatar image

Nano
32 1 2 4

Jun 16 '12 at 12:23 PM Fattie

Very NICE and AWESOME !!! Great Thanks !!!

Jun 16 '12 at 01:45 PM Nano
(comments are locked)
10|3000 characters needed characters left

My some NEW experiments TestMesh.cs

From this sources I've been understood that UV coordinates conform to each Mesh's Vertex and triangles are regions which will be painted out by texture, thus triangles are used in Mesh's Set of Vertexes and in TEXTURE's UV Set of Coordinates ;-)

Thanks !

TestMesh.cs.zip (628 B)
more ▼

answered Jun 17 '12 at 06:47 AM

Nano gravatar image

Nano
32 1 2 4

(comments are locked)
10|3000 characters needed characters left

Test Mesh Texture's Triangles download Source example: TestMesh.cs

TestMesh.cs.zip (639 B)
more ▼

answered Jun 17 '12 at 06:57 AM

Nano gravatar image

Nano
32 1 2 4

(comments are locked)
10|3000 characters needed characters left

I'm trying to do this in 2D space and I was speaking about 2D polygon (gish or blob).

more ▼

answered Jun 15 '12 at 10:04 PM

Nano gravatar image

Nano
32 1 2 4

Just edit your original question if you like!

Just FYI that game is not "2D" ... it's a 3D game with 3D game physics, but you just happen to see only an orthogonal view so it looks 2D. So it is "2.5D"

Jun 16 '12 at 04:28 AM Fattie

Thanks Very Much for Your answer ! You're absolutely right about 2.5D game. I'm newbie in Unity3D. Can anybody help me ? http://www.gamedev.net/topic/624248-stretch-a-texture-on-a-2d-polygon/ (I just want something like this to make in Unity)

Jun 16 '12 at 07:07 AM Nano

simply move the vertices inside the object. exactly as it says on that web page!

You are going to have to learn everything about real time mesh manipulation. I have explained how to get started with that, in the comment below. I will paste it in again.

"To begin building mesh on the fly, create a cube in Unity. Attach a script to it. Learn how to get at the Mesh components, and then learn how to create new mesh arrays, then, figure out how to make the mesh from your new arrays.

All the info is here in basic form:

http://unity3d.com/support/documentation/ScriptReference/Mesh.html "

Please note that this has no connection to the effect you are seeing in the youtube movie.

Jun 16 '12 at 07:31 AM Fattie

Thank You VERY VERY MUCH !!!!!

Jun 16 '12 at 08:12 AM Nano

not at all, ask anything any time. I love the blobby sample you brought to the site, thanks for that

Jun 17 '12 at 08:08 AM Fattie
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3892
x2276
x9

asked: Jun 15 '12 at 03:55 PM

Seen: 971 times

Last Updated: Jun 17 '12 at 08:08 AM