Requesting a Sample code to Scale object using Transformable Shape and Vertices Manipulation #26
Replies: 1 comment
-
The physical and graphical representations are independent; if you want the graphical representation to change, you'll need to also apply the transform to it. That's not related to bepuphysics1, though; the implementation would depend on how you're handling graphics. (The bepuphysics1 demos renderer has hardcoded awareness of the physical shape types, and knows how to make graphical meshes for them. I wouldn't recommend using the demos renderer for anything, or even really borrowing its architecture, but the TransformableShapes go through DisplayConvex. It samples the shape in a bunch of directions to create a mesh from it. Again, this is very likely not what you would want to do in your own renderer; just applying the transform to the graphical model when rendering would be easier and faster.) |
Beta Was this translation helpful? Give feedback.
-
Hello Sir,
In my project I wish to scale convex mesh if certain conditions are met, I gone through several threads in older bepu forums and and I found that everywhere you have suggested to bake vertices of the shape or use Transformable shape and apply linear transformation.
I tried transformable shape method and applied required scale. Unfortunately the convex shape in Viewport doesn't show scaled , but it generates contacts as per the new scaled instance. As per my requirement the effect should be also be visible in viewport along with correct contact generation. So can you please show a piece of code which accomplish this task using Vertices Bake method as well as Transformable shape method.
Beta Was this translation helpful? Give feedback.
All reactions