Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: path_to_model (GM6 Script)  (Read 967 times)

0 Members and 1 Guest are viewing this topic.
path_to_model (GM6 Script)
« on: November 12, 2006, 07:11:25 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1635
I made a script which will take a path and store it in a model. This is really useful, as the model can be manipulated many ways. Or it can be drawn - this is just a good way to draw a path, because once it's stored in the model, you can just draw the model. Anyway, here you go:

Code: [Select]
model = d3d_model_create();
d3d_model_primitive_begin(model,pr_linestrip);
pn = path_get_number(argument0)*path_get_precision(argument0);
for (i = 0; i < pn; i += 1)
    d3d_model_vertex_color(model, path_get_x(argument0, i/pn), path_get_y(argument0, i/pn), 0, c_white, 1);

d3d_model_vertex_color(model, path_get_x(argument0, 0), path_get_y(argument0, 0), 0, c_white, 1);
d3d_model_primitive_end(model);

Enjoy!
« Last Edit: March 01, 2007, 01:17:24 am by 4Sword »
Logged
Re: path_to_model (GM6 Script)
« Reply #1 on: November 12, 2006, 08:00:35 pm »
  • Credits to BaB
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Posts: 807
Well, I'm sure that if you would compile an example, it would be helpful.
Logged
Re: path_to_model (GM6 Script)
« Reply #2 on: November 13, 2006, 02:14:52 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1635
My pleasure.
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.054 seconds with 41 queries.

anything