playMaker

Author Topic: Possible Extension of Vectrosity Shape-making Actions?  (Read 6825 times)

memetic arts

  • Full Member
  • ***
  • Posts: 141
Possible Extension of Vectrosity Shape-making Actions?
« on: June 19, 2013, 12:40:40 AM »
Hi -

I'd started (and now closed) a thread in the Help forum seeking a solution to an issue in which I was using the Vectrosity / MakeCircle action and trying to get the circle to follow a spline (which was also generated with Vectrosity, albeit with script).

What I came to discover was that while the spline was created as a Vector3, the Circle was a Vector2, and therefore attempts to set it on 3d coordinates were failing.

I resolved this in pure script, but cannot see a way to do it with the existing MakeCircle action.  Basically, the linepoints need to be declared as a Vector3 from the get-go, as does the parameter for setting the origin, and the Draw() function needs to be changed to Draw3D

Additionally, in order to get the Circle rotated properly, I also had to include the Vector3.up parameter in the function call.  This property is not available in the current MakeCircle action either.

For reference, here is the script I was using to resolve the issue.  The commented parts are the original script, for comparison sake.

Code: [Select]
#pragma strict

import Vectrosity;
var segments = 16;
var lineMaterial : Material;
var radius = 2.0;

function Start () {
//var linePoints = new Vector2[segments+1];
//var line = new VectorLine("Line", linePoints, lineMaterial, 3.0, LineType.Continuous);
//line.MakeCircle (Vector2(2,0), radius);
//line.Draw();

var linePoints = new Vector3[segments+1];
var line = new VectorLine("Line", linePoints, lineMaterial, 0.5, LineType.Continuous);
line.MakeCircle (Vector3.zero, Vector3.up, radius);
line.Draw3D();
}

Any way these features could be implemented to extend the existing actions?

I was going to do it myself, but am a total noob with Action creation . . . this would probably take Jean Fabre a matter of minutes to spin out.  :)

Thanks in advance!
« Last Edit: June 25, 2013, 01:43:56 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #1 on: June 19, 2013, 01:35:40 AM »
Hi,

 Yes, you are right, making 3d circle will require a new actions ( for clarity mainly).

The existing actions should remains, a new set is required actually, so this would be quite involving indeed. I am running behind on many other tasks like Ultimate FPS camera support, photon etc, so I need to finish few things first, then I can tackle vectrosity. The interest for vectrosity support is growing, I am aware of this, so it will come, don't worry.

bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #2 on: June 19, 2013, 07:01:11 AM »
Thanks, Jean, I understand completely re: the backlog.  And thanks for the work on the NGUI actions, btw, can't wait to dig into those!   :)

I had taken a look at the existing MakeCircle action, and really just thought that I could extend it by adding a Boolean like "is3D", which, if true, would follow a set of alternate code blocks to account for the relatively minor differences shown above.

So I guess we'll see how far I can get with this -- like I said, I'm a total noob re: Action Development, and I've got my own backlog of tasks -- at this point it would be much faster for me to just use straight script and prefab it -- but we'll see, maybe this is the right time to jump in.

Thanks for the input and support, though, very much appreciated.

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #3 on: June 19, 2013, 04:46:50 PM »
Well, that was actually much easier than I'd anticipated.  New Make3DCircle action is attached.

Basically, it's a dupe of MakeCircle, with a few minor adjustments, which I've commented inline. 

Let me know if it's up to snuff or if I need to make any changes.

Cheers,

==rr

« Last Edit: June 19, 2013, 05:02:26 PM by memetic arts »

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #4 on: June 19, 2013, 09:19:12 PM »
I started browsing through the Actions "library" and stumbled on a Vector2-to-Vector3 action, posted in this thread. . .

http://hutonggames.com/playmakerforum/index.php?topic=2894.0

Could this be used in conjunction with the Vectrosity actions to achieve the same result?  Not as clean as a dedicated action, of course, but maybe a decent band-aid?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #5 on: June 20, 2013, 01:37:16 AM »
Hi,

 yes, within your own logic it could be helpfull, but as for vectrosity actions, they will need to take this into account from scratch.

bye,

 Jean

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #6 on: June 20, 2013, 10:09:52 AM »
Thanks, makes sense.

Any feedback on the Action that I'd attached?  It works, but not sure if it's the way you'd want it had you done it yourself . . . any tips/feedback would be appreciated.

Cheers.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #7 on: June 24, 2013, 06:57:35 AM »
Hi,

 In terms of code, nothing to say, that's all good. I need to make a rundown on all these and samples. I have your action in the project, so the next release will feature your work. Thanks :)

bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #8 on: June 24, 2013, 06:58:57 AM »
Hi,
 
 yes, one thing as I clicked on "submit" thread. It would be good to have these 3d actions letting the user define a gameObject as the parent, so that defining the position and orientation is taken from the gameObject. That would be what I would work on from there.

bye

Jean

memetic arts

  • Full Member
  • ***
  • Posts: 141
Re: Possible Extension of Vectrosity Shape-making Actions?
« Reply #9 on: June 24, 2013, 08:51:51 AM »
Thanks, Jean.  Good idea to include setParent -- I'd been combining this and the original setParent within the same state anyway, even better to fuse them together into a single action.

To paraphrase what I think you said in another thread somewhere, cut & paste are a developer's best friend!  :)

Cheers