Forum

How to create 2D playing cards

21 May 2015 23:28 #2457
Dear All,

I have a newbie question: How to create 2D cards, like in a card game but to have them in 3d?

Would I need to create 2D planes in blender or could I create them dynamically in JavaScript?

And to apply a texture to them would this be easy?

Please help if you can.

Thanks
22 May 2015 12:15 #2461
There are some ways to do it :) I talked with our coder and we decided that the better way is to use canvas textures.

Here is an exapmle:

cards.zip
3D Generalist, contests administrator,
Blend4Web team.
art blog: http://contret-art.tumblr.com/
22 May 2015 12:24 #2462
Wow this is awesome! Thanks!
22 May 2015 19:22 #2466

Ответ на сообщение пользователя Pavel Kotov
There are some ways to do it :) I talked with our coder and we decided that the better way is to use canvas textures.

Here is an exapmle:

cards.zip

Is it ok to use this example as the basis for a GPLv3 project? I am making a 3d game which will be GPLv3.
22 May 2015 19:45 #2467

Is it ok to use this example as the basis for a GPLv3 project? I am making a 3d game which will be GPLv3.

Of course! Not sure about textures though, they were simply downloaded from somewhere.
Development Lead | Twitter
22 May 2015 21:15 #2471

Ответ на сообщение пользователя Yuri Kovelenov
Of course! Not sure about textures though, they were simply downloaded from somewhere.

Thanks. It may seem like an odd question, but is there an easy way to texture multiple cards with different textures? I have created some duplicate cards and I want to somehow have different textures on each card. I tried changing the material/texture on each card but it did not work, they all have the same texture.
22 May 2015 22:00 #2472
Thanks. It may seem like an odd question, but is there an easy way to texture multiple cards with different textures? I have created some duplicate cards and I want to somehow have different textures on each card. I tried changing the material/texture on each card but it did not work, they all have the same texture.

Well, I would recommend creating the whole pack of cards in Blender. That would also allow to use a single texture atlas for all the images and would greatly improve the app's loading speed and the overall performance.
Development Lead | Twitter
22 May 2015 22:32 #2476

Ответ на сообщение пользователя Yuri Kovelenov
Well, I would recommend creating the whole pack of cards in Blender. That would also allow to use a single texture atlas for all the images and would greatly improve the app's loading speed and the overall performance.

You are right that would make more sense. I am also interested in how to use canvas textures just generally interested anyway. I have found your canvas_texture demo and I see that there is a Blend4Web section under the 'Texture' tab in Blender - where you can set the source id of that texture. However I don't seem to be able to get this Blend4Web section to appear in another Blender file.

I apologise for such newbie questions
22 May 2015 22:42 #2477

I have found your canvas_texture demo and I see that there is a Blend4Web section under the 'Texture' tab in Blender - where you can set the source id of that texture. However I don't seem to be able to get this Blend4Web section to appear in another Blender file.

Is there something I am missing?

Maybe a different texture type?
https://www.blend4web.com/doc/en/textures.html#index-12
Development Lead | Twitter
22 May 2015 22:48 #2478
Sorry, I just figured out how to do it! You select "Blend4Web" from the top menu bar. Silly me!

I am using a newly created Blender file for testing and…

For some reason there is no mention of a canvas inside the "Blend4Web" section under the 'Texture' tab.
 
Please register or log in to leave a reply.