Game Development Community

Torquescript + animation + object picking

by Jendrik Posche · in Technical Issues · 04/09/2008 (7:35 am) · 2 replies

Hi All,

I have a couple of questions regarding the Torquescript/engine.

I want to do the following, since I'm not going to make a fps/rts type of game.

How do I:

1. Programmatically create an animation? I just want to code my own animation and NOT use the dts/dsq stuff. By just using quarternions and matrices. Which function calls do I need to override, implement to make this happen to a certain dts object. Do I need to write my own update() or postrender() function?


2. Picking objects with the mouse pointer. How can I determine through torquescript which object my mouse just clicked? Do I need to write my own engine function for this? Or can I can just call a torque function


3. How can I access vertex data of the dts shape with torquescript or do I need to fiddle with the engine itself?


Thanks,

Iskandar

#1
04/09/2008 (8:05 pm)
As far as I know you can access the vertex data by the following


%xfrm = %shape.getTransform();
%lx = getword(%xfrm, 0);
%ly = getword(%xfrm, 1);
%lz = getword(%xfrm, 2);
%rx = getword(%xfrm, 3);
%ry = getword(%xfrm, 4);
%rz = getword(%xfrm, 5);
%rd = 1.0;

Then to move the object you would modify those values and:

%shape.setTransform(%lx SPC %ly SPC %lz SPC %rx SPC %ry SPC %rz SPC %rd)
#2
04/10/2008 (9:29 am)
Ok, but what about ; vertex colors? vertex normals? the texture coordinates?