Home Tutorials Download Beta Store Forum Documentation KnowledgeBase Wiki Blog

ShiVa3D

Return to Game programming

how detach human organ?  [SOLVED]

All about the StoneScript

how detach human organ?

Postby cheshm69 » 20 Jul 2012, 04:56

hi!
in the game of plant vs zombie when a zombie hurt,his hand detach from his body or his hat off from his head.
or in the angry bird's game when a pig shot, his eye become Bruise.

how they do that in the 2d world?

it's impossible that they change whole picture of one character.

thnx
cheshm69
Expert Boarder
Expert Boarder
 
Posts: 84

Re: how detach human organ?

Postby DoctorPepper » 20 Jul 2012, 05:36

The complete image consists out of several sub images ( 1 for the head, 1 for the eye), and they simply replace the texture.
In some engines, it is possible to overlay 2 images, but in engines like shiva,you will then lose the ability to use lightmaps (which i realize is irrelevant in 2d)
User avatar
DoctorPepper
Platinum Boarder
Platinum Boarder
 
Posts: 474
Location: Belgium

Re: how detach human organ?

Postby cheshm69 » 20 Jul 2012, 16:13

DoctorPepper wrote:The complete image consists out of several sub images ( 1 for the head, 1 for the eye), and they simply replace the texture.
In some engines, it is possible to overlay 2 images, but in engines like shiva,you will then lose the ability to use lightmaps (which i realize is irrelevant in 2d)


thanks DoctorPepper!

it's impossible for replace the texture if you look plant vs zombie.
when one kind of zombie hurt his hat fall off and drop on the ground . it can't be complete image.

how i can overlay images in shiva ? please help

i use plan and attach a material to it and then group this plan by other related plans
butt it is onerous
cheshm69
Expert Boarder
Expert Boarder
 
Posts: 84

Re: how detach human organ?

Postby cheshm69 » 21 Jul 2012, 06:23

Does anyone an idea?
cheshm69
Expert Boarder
Expert Boarder
 
Posts: 84

Re: how detach human organ?

Postby DoctorPepper » 21 Jul 2012, 21:13

If you are using HUD, you have to create 2 objects and match translation with the code
If you are using 3D planes, you can simply attach an object to a parent with 1 line
User avatar
DoctorPepper
Platinum Boarder
Platinum Boarder
 
Posts: 474
Location: Belgium

Re: how detach human organ?

Postby cheshm69 » 22 Jul 2012, 05:41

DoctorPepper wrote:If you are using HUD, you have to create 2 objects and match translation with the code
If you are using 3D planes, you can simply attach an object to a parent with 1 line


thank for your answer!
i have same idea (i use 3d plane).
but it is difficult way (for example moving hand to sync with body movement)
is there easier way to solve it?

again thank you
cheshm69
Expert Boarder
Expert Boarder
 
Posts: 84

Re: how detach human organ?

Postby DoctorPepper » 22 Jul 2012, 21:29

Depends on how you animate your hands.
object.setParent will match the translation of the planes.
When drawing an animation, jump for example, draw it as 1 piece with 2 layers. 1 for the hands and one for everything else. Export the images twice, 1st with layer 1 hidden, second with layer 2 hidden.
In shiva, as those images have the same size, you can place them on top of each other, creating an illusion that those two are connected.
Synchronously change the texturemap for the both.
Its the only way i could think of. In shiva its a piece of cake, you only need to write your code once. Hardest part would be to separate layers in photoshop or whatever you are using
User avatar
DoctorPepper
Platinum Boarder
Platinum Boarder
 
Posts: 474
Location: Belgium

Re: how detach human organ?  [SOLVED]

Postby cheshm69 » 23 Jul 2012, 07:31

DoctorPepper wrote:Depends on how you animate your hands.
object.setParent will match the translation of the planes.
When drawing an animation, jump for example, draw it as 1 piece with 2 layers. 1 for the hands and one for everything else. Export the images twice, 1st with layer 1 hidden, second with layer 2 hidden.
In shiva, as those images have the same size, you can place them on top of each other, creating an illusion that those two are connected.
Synchronously change the texturemap for the both.
Its the only way i could think of. In shiva its a piece of cake, you only need to write your code once. Hardest part would be to separate layers in photoshop or whatever you are using


thank you DoctorPepper i eventually do something like your idea.
thanks again
cheshm69
Expert Boarder
Expert Boarder
 
Posts: 84


Return to Game programming