saindd Posted August 12, 2015 Share Posted August 12, 2015 Is there a mesh creation API for Torque 3D, that allows me to create meshes in code and adapt them procedurally according to parameters? I'm planning to create something like this: Quote Link to comment Share on other sites More sharing options...
JeffR Posted August 12, 2015 Share Posted August 12, 2015 You can easily create static meshes in code.just simply doing %newStatic = new TSStatic() { shapeFile = "modelfile.dae"; position = %raycastPos; }; That'll create it.You'd need to do a raycast from the eye to get the position that the user is looking at, and then decide how you want to store those created objects, but the basics of the concept are actually very easy. Quote Link to comment Share on other sites More sharing options...
saindd Posted August 13, 2015 Author Share Posted August 13, 2015 That's nice, thanks! In order to display the transparent version of the mesh, should i just apply a different material and, if the user clicks, apply another? Also, how can i efficiently do this without killing memory? I intend to spawn the TSStatic at the raycastPos and remove it soon after the mouse moves and just not remove it once the player clicks. Quote Link to comment Share on other sites More sharing options...
buckmaster Posted August 14, 2015 Share Posted August 14, 2015 I don't think you're likely to kill memory unless you have like 500 people doing this at the same time, or your mesh files are huge. What do you mean by removing it soon after the mouse moves? Quote Link to comment Share on other sites More sharing options...
JeffR Posted August 14, 2015 Share Posted August 14, 2015 If you mean like in the UE4 vid, where it wouldn't display the 'holographic' version unless you were looking at a valid snap point?You could spawn the mesh, and then use a schedule or tickable object to do an update check for what you're looking at. If you're looking at a valid location, you move the static + see through material into place.If you're not looking at a valid location, just set it to hidden.Likely the best way to do it is have a player have a static mesh stored to them, and just swap out the mesh displayed for your holographic/previs view.When they actually place the mesh, just spawn a new one into the level as normal. That'd probably be a bit easier of a workflow. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.