# Deforming a car on impact

For questions about using Classic.

### » Wed Aug 10, 2011 7:39 pm

Well, ok. But how? We are talking about distorting the mesh relative to the shape of another
( possibly a bad expplenation, so here is a pciture)
off course not as smoot as on the picture, more "bent invards"
B
18
S
4
G
1
Posts: 413
Reputation: 2,512

### » Wed Aug 10, 2011 7:57 pm

You won't be able to do it in construct. Last time I checked carma quite literally just moved the vertices in their cars depending on the collision. You can't manipulate 3d objects at all in construct. I doubt you can do it with sprites.
B
3
S
1
G
3
Posts: 83
Reputation: 1,191

### » Wed Aug 10, 2011 9:00 pm

[QUOTE=Instant] You won't be able to do it in construct. Last time I checked carma quite literally just moved the vertices in their cars depending on the collision. You can't manipulate 3d objects at all in construct. I doubt you can do it with sprites.[/QUOTE] You can. The action is called "Set relative displacement".
You'd move the vertices dependent on the distance of the overlap. If car2's left edge is at x = 50 and car1's right edge at x = 70, you have a distance of 20 pixels. Translate that to the vertices of Car1 and move them away from the impact point, with a strength dependent on the distance of each vertex from the impact point. The degree of realism of the impact would be dependent on the number of vertices you use per car.

At least I think it would have to be done this way.
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,289

### » Wed Aug 10, 2011 9:54 pm

[QUOTE=tulamide] [QUOTE=Instant] You won't be able to do it in construct. Last time I checked carma quite literally just moved the vertices in their cars depending on the collision. You can't manipulate 3d objects at all in construct. I doubt you can do it with sprites.[/QUOTE] You can. The action is called "Set relative displacement".
You'd move the vertices dependent on the distance of the overlap. If car2's left edge is at x = 50 and car1's right edge at x = 70, you have a distance of 20 pixels. Translate that to the vertices of Car1 and move them away from the impact point, with a strength dependent on the distance of each vertex from the impact point. The degree of realism of the impact would be dependent on the number of vertices you use per car.

At least I think it would have to be done this way.[/QUOTE]

This^

You can't do collision detection from distortmaps, but you can use a hit box. Ideally you could create a grid of points using the system condition object collides with point. However its a little complicated to rotate those points to line up with the mesh all the time.
B
178
S
50
G
206
Posts: 8,686
Reputation: 127,715

Previous

Return to Help & Support using Construct Classic

### Who is online

Users browsing this forum: No registered users and 0 guests