Game Development Community

Drawing wires or cables

by Tobias B. · in Torque 3D Professional · 05/17/2010 (4:59 am) · 4 replies

Hi,

I'm thinking of a scenery where I need to draw cables/wires as straight lines with changing lenghts to connect moving objects.

Has anyone an idea how to realize that in a simple way? Especially the length change at runtime? I thought of taking a cylinder and scaling it during runtime, but mybe there are more elegant ways to to that?

Thanks and best regards,

Tobias

#1
05/17/2010 (5:39 am)
I'd write a custom object class that takes a skinned cable model (TSShapeInstance) and manipulates its joint positions directly to connect the two objects.
#2
05/17/2010 (9:47 am)
Just from a usability standpoint is there some example somewhere on how to do that? Or some example in the source he should look at?
#3
05/17/2010 (10:53 am)
Yes. There's a sample class called RenderShapeExample, which is meant how to do a simple object that loads a shape from a file and renders it.

As for manipulating the joints, the Turret Resource should be a good example, since it controls the turret by rotating a node directly from code.
#4
05/27/2010 (12:46 am)
Thanks!