Draw 3d primitives with TGE...
by James Moliere · in Technical Issues · 09/10/2008 (11:35 pm) · 3 replies
Hello,
I would prefer to draw 3D primitives such as cylinders and spheres with Torque Script. I would really like to programatically place a 3D renderable object in space and move it around programatically. Is this (easily) possible? I really don't want to use a 3D drawing program with bones, etc.
Thanks!
I would prefer to draw 3D primitives such as cylinders and spheres with Torque Script. I would really like to programatically place a 3D renderable object in space and move it around programatically. Is this (easily) possible? I really don't want to use a 3D drawing program with bones, etc.
Thanks!
#2
Your easiest approach is to use the 3D drawing program with bones, etc. Or hire someone that can use those programs. I know I can't :(
09/11/2008 (2:58 am)
You can do all of that programmatically, fairly easily, and in script. I don't recommend it though, as scripting openGL calls will probably make your frame rate drop significantly. Though easy, it would also be very time consuming to create.Your easiest approach is to use the 3D drawing program with bones, etc. Or hire someone that can use those programs. I know I can't :(
#3
Keep in mind these are wireframe or solid color primitives nothing fancy like what you could do with a real model / texture.
The editor actually already has the ability to draw spheres if you look into how spawn spheres are rendered when the editor is open.
09/11/2008 (12:57 pm)
I also wanted something similar James, mostly for debug rendering, and did this by adding onto the GFXDrawUtil class. Eg, DrawUtil->drawCylinder, drawSphere, drawArrow, drawCone, stuff like that. Keep in mind these are wireframe or solid color primitives nothing fancy like what you could do with a real model / texture.
The editor actually already has the ability to draw spheres if you look into how spawn spheres are rendered when the editor is open.
Torque Owner Mikael Pettersson
Snowpeak Studios
just export one of each shape from your favorite 3d modeling tool (unwrapped) and then you can manipulate the texture by scripting the material.cs file (will probable require reboots of the client for texture changes to take effect). and scale, move ant rotate is provided stock in with the mission editor.