HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

2D Simple Shape System (2D3S) Line Shape opinion

08-08-2009, 04:17 PM#1
Flame_Phoenix
So, you all know 2D3S, a system that will soon allow people to make awesome spells with awesome shapes.
The reason why I am posting this thread here is because I made a major modification to one of the modules. In order to keep progress going on, I need to know if this specific module is Ok, so I can replicate the main idea into other modules.
What I need to know is, if you think the xefxLineModule is nice, that's all I ask.

I also post here 2D3S core and Line shape, you will see how trivial they are:

Core:
Expand JASS:

LineShape:
Expand JASS:

xefxLineModule
Expand JASS:

Thx in advance...
08-08-2009, 06:50 PM#2
Tot
I'm not quite good in coding, but the upper two seem to work (not really tried)
it's very similiar to what I used in my TFormula lib, so it should work


the last one I don't understand (need time to read it)


haaahaaa you're using a squareRoot, I thought they are bad

too stupid that I'm too stupid to code something like this (but better), too

@Scar: won my bet a gramatically correct english sentence with more than 3x "too"! BÄM!
08-08-2009, 07:12 PM#3
Flame_Phoenix
Everything here works fine Tot. I am only worried about the "cleanness" of the code.

Quote:
haaahaaa you're using a squareRoot, I thought they are bad
And I avoid them every time I can. However in this case, I can't optimize more. I need the SquareRoot because of the division I make in the line:
Collapse JASS:
 local integer size = R2I(dist / (interval ) )

Quote:
too stupid that I'm too stupid to code something like this (but better), too
You think you are too stupid to code something like this or better? Bah, I don't believe you. Seriously, you made TFORMULA, something I would never do in a million years. You CAN do this if you want to. I am quite happy to help you understand my code if you need help.
I see few people are familiar with module keywword, but it is in fact the easiest thing on earth:
http://www.wc3c.net/vexorian/jasshel...al.html#module
08-08-2009, 07:16 PM#4
Tot
yay, I've only a probleme with 3d shapes and i wanna make a Tesseract

no idea what it is, but I'm sure it's smoething in 3d...

but have first to finish the sms
08-09-2009, 01:28 AM#5
Anitarf
The xefx and the lightning modules could easily be the same for all shapes.
08-09-2009, 08:04 AM#6
Flame_Phoenix
Quote:
The xefx and the lightning modules could easily be the same for all shapes.
I seriously don't see how.
For a complex shape like an XSpot (per example) I use the xefxLineModule of the oject line. For a simple shape like a line, I have to code it like here.
Your approach also occurred me, but I didn't see a way of having them for all shapes. I thought "Maybe if I add a massive if statement like If Shape== Line then draw line else ..."but I saw that as a very ugly idea ...
08-09-2009, 03:32 PM#7
Anitarf
Shapes are just lists of points anyway. You should be able to create an effect for each of those points regardless of how those points are distributed.
08-09-2009, 05:55 PM#8
Flame_Phoenix
I know I could make an xefx module for all simple shapes. However, it is not that easy for complex shapes. How can I tell the difference between a 5 point star (made by 5 lines) and a 7 point star? What about a pentagon with a circle? There is no sane way to make a unique xefx module for all complex shapes, since they are made by many simple shapes or even by other complex shapes - I have to make an xefx module for each complex shape.
08-16-2009, 10:28 AM#9
Flame_Phoenix
A few days have past and I made more major modifications to xefxLineModule by completely remaking it. I can also attach a test map for those who want.
Now xefxmodule is using a stack (I learned it from DarkLightning xD) and it only has 5 mehotds (pretty small).

To be honest, I've been thinking on Anitarf's idea of creating one xefxModule for all simple shapes and another xefxModule for complex shapes ... few days ago I was having a walk to clear my mind and it occurred me such a thing may be possible if I use a List to store the shapes a complex shape needs. I have not tested this idea yet, but it is a possibility.
I am open to suggestions, if I manage to make the complex list idea real, this may become the module for all simple shapes.

PS: I hope this doesn't count as reviving a thread.
08-17-2009, 11:53 AM#10
Flame_Phoenix
Bump, I've been thinking, there is no way I can follow ani's suggestion... =S
Anyways, 1st post uptaded.
08-17-2009, 12:35 PM#11
chobibo
How about putting all methods into a single struct? I dunno exactly what you mean by using 1 module. If I understand it right, points are just connected to form shapes, if so just make different methods that connects those points, and put them in one module.