Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - lithander

Pages: [1]
1
Graphics / Re: Best way to create an Arrow-Shape
« on: April 06, 2015, 09:19:38 pm »
Thanks for the discussion. I've learned a lot about SFML through it.

Shadowmouse, that's not a stupid suggestion. I'll probably just do that. But first I wanted to make sure that there isn't some easy way to generate one procedurally. That wasn't obvious to me from the beginning.

I'm tempted to mess with triangulation of paths and other primitive shapes and maybe make something worthy of contributing to the community. But for now I'm swamped with work so this'll have to wait. :(

2
Graphics / Re: Best way to create an Arrow-Shape
« on: April 06, 2015, 02:20:57 am »
Can you explain more of what you are after? Because there is an outline in the arrow class.  ???
Maybe I was looking at an old version?
https://bitbucket.org/zsbzsb/netext/src/5f3d9f38b34d7a6738bcac259160650e75c62f5c/NetEXT/Shapes/Arrow.cs?at=feature/shapes
The arrow rendered here consists of a stem ("Line") and a tip ("Triangle") rendered in a given color. But the shapes build into SFML support an outline that traces the silhoutte of the shape in a second color.

What I'm looking for is like this:

No code here that would do that, or am I missing something?  :-[

Quote
Quote
What bugs me, though, is that the shape implementation obviously has access to path rendering (e.g connected line segments with a thickness) but that usability isn't exposed to the user.
Huh? No it doesn't, why don't you look at the implementation and you will see all it does is use vertex arrays that are exposed through the public API.

Quote
otherwise the fact that many drawcalls per shape-vertex are necessary will hurt a lot

Again, it is implemented via vertex arrays which means 1 draw call per array.

SFML Shape is fine. I'm talking about the ConvexShape in Thor.
https://github.com/Bromeon/Thor/blob/master/src/ConcaveShape.cpp

Look at formOutline and draw methods. There's one shape, per tesselated tri. 2 shapes per edge. So some arbitrary polygon that consists of 10 edges and tesselates into say 10 triangles will need ~30 drawcalls. Am I right?

Quote
Quote
SFML would really benefit from build-in path rendering with arbitrary thickness

Well to me this seems to be a very specific high level feature request. SFML aims to provide all the building blocks to do just about anything you want. Also the current mind set is to not implement something in SFML that can be handled outside the library. However, feel free to open a thread in the suggestions forums - just remember my previous sentence.  ;)

It's probably true that this kind of feature could be implemented outside SFML just not by a layman and not quickly. I can see that what you describe as the "current mindset" makes sense for a hardware abstraction layer that has "simple" in his name. ;) I'm just spoiled from e.g. the flash API or the Cinder framework, I guess. :)

3
Graphics / Re: Best way to create an Arrow-Shape
« on: April 05, 2015, 11:28:04 pm »
Thanks for your replies!

I've had a look at NetEXT but that particular arrow implementation wasn't exactly what I'm looking for. (I'm sure I'll have a more in depth peek later as it seems to be fountain of *other* useful stuff, though) But what I need the arrow shape to do is to render a thick outline in addition to the filled shape.

Of course I'm not expecting SFML to have everything exactly the way I need it but that's what all the build in shapes provide. So I thought I could just extend the basic Shape class like CircleShape and RectangleShape do to arrive there.

Now, seeing how much work you guys have put into extension librarys I guess the scope of SFML is just a bit narrower then what I thought. No problem. What bugs me, though, is that the shape implementation obviously has access to path rendering (e.g connected line segments with a thickness) but that usability isn't exposed to the user.  :(

Anyway, how to approach that problem? Thor composes concave shapes as a combination of primitive shapes (circles & rects for the edges, tris for the body) which is flexible enough to cover arbitrary polygons (except polygons with holes, right?) and would work alright if draw performance is not an issue (otherwise the fact that many drawcalls per shape-vertex are necessary will hurt a lot). Biggest issue for me however: it's not ported yet. ;)

From my noobs point of view I think that SFML would really benefit from build-in path rendering with arbitrary thickness. (If not more vector graphics features ala http://en.wikipedia.org/wiki/OpenVG) Has this allready been proposed as a feature request? Or is there an extension that does that? If I started to write my own code in that area that would feel like a full-featured side-project instead of something I could justify to do at work. ;/

P.S.: I'm not trying to step on anyones toes. Just trying to figure out how SFML want's to be used! :)

4
Graphics / Best way to create an Arrow-Shape
« on: April 04, 2015, 10:15:16 pm »
An arrow is not a convex shape and so my first naive implementation by just deriving a class ArrowShape from Shape and returning the 7 points that are needed for a basic arrow didn't work out. (Outline renders okay, but filling doesn't work)

So, now I'm wondering whats the best practice to get something like this done? I want to be able to support the full range of Shape's features including LineThickness and FillColor. Should I use and render VertexArrays (but how do I set the LineThickness when rendering line primitives?) or should I use a composition of shapes? (the syncing of all the public properties that a shape typically has seems like a lot of work for such a basic goal)

What's the best practice?

I'm using SFML.Net btw

5
General discussions / Re: SFML .Net for teaching purposes
« on: March 03, 2015, 01:15:07 pm »
Either way, would really be interested in seeing the results later on, or some feedback where students had most issues, where something wasn't clear enough (e.g. documentation or naming convention), etc. :)

If there are issues worth mentioning I'll make sure to let you guys know! But for now I'm really happy that I've stumbled upon SFML. The tutorials make a great impression!

6
General discussions / Re: SFML .Net for teaching purposes
« on: March 03, 2015, 12:58:40 pm »
My take on freedom of choice in teaching/learning has changed considerably of the last couple of years. At a company it's usually the most senior and qualified members that make decisions. And most of these choices are just the necessary consequences based on conditions outside their control. You try to understand the problem before you make a decision - if you don't have enough information for an educated decision don't make a decision at all. So, are my students really qualified to pick the language thats right for them? They'll most likely pick something they are allready comfortable with but not what promises the best learning experience or results.

Software engineering isn’t for someone who wants to stick with what they know. The technology is always changing, and engineers have to adapt and evolve, too.
So I think that regarding to the choice of language, project goal etc it's not only more real-world like but also better for the individual students if I chose for them. Hopefully I'm much more qualified otherwise I shouldn't have gotten the job. If that means that they can't work with their favorite language or game design that's not a problem but a chance to grow. In hindsight my favorite teachers have allways been those with a strong opinion and the ability to convince.

7
General discussions / Re: SFML .Net for teaching purposes
« on: February 28, 2015, 12:47:29 am »
I'm as good as sold on SFML. If a basic game loop is more conceptional trouble then the hardware interface library than the latter does a good job indeed! ;)

I'm kidding of course. The game loop is a stellar example of a game programming pattern. Most games have one while the majority of non-game applications doesn't use a concept like that.

You're right that the patterns I'm trying to teach are mostly language agnostic. What we'll do in C# could be done in Java, too. In both cases I'd have to skip most details about memory management, though, as that is rather pointless in a garbage collected language. So there'd be a good reason to use C++ even if it's a lot harder to pick up for a Java guy than C#.
I can ask the students for opinions but I can't imagine a course where every student starts of on a different OS in a different language with a different genre and game design in mind. From my experience narrow constraints really help to keep focused and on the same track.

8
General discussions / Re: SFML .Net for teaching purposes
« on: February 24, 2015, 04:29:12 pm »
My question was mostly related to the pros & cons of SFML in my specific usecase. With a the technology that I use on a daily basis I've got a good intuition wether it's beginner friendly and what concepts are easy to grasp compared where there are pitfalls. But I lack that experience with SFML so I thought I could ask the experienced users for an opinion! How steep is the learning curve? What do new users struggle with? Have you tried teaching with it? Stuff like that.

Regarding Java I can tell you the reasons I don't want to use it. But lets not turn this into a language war. First of all there are a wealth of langauge extensions that got integrated into C# over the last couple of years that I think are almost mandatory knowledge for someone with a degree in computer science and that are not part of Java. Especially first class functions & closures come to mind. (Ironically they are important part of JavaScript.)
Another good reason for C# is that it is more widely used in game development then Java.
But the most important reason is of course that I'm much more fluent and experienced with C# then any other language. ;)

9
General discussions / SFML .Net for teaching purposes
« on: February 24, 2015, 01:17:42 pm »
Hey guys!

I'm going to teach a course dubbed "Game Programming Patterns" in a couple of weeks at a local university for the first time. There will be weekly lectures but also a lab where students will work in teams on some small scale game project to experience typical problems and established solutions (said patterns) first hand.

The students will be in their 3rd year of studying multimedia engineering (some media oriented variant of computer science) so they have some coding background in Java and basic math knowledge but I wouldn't want to take too much for granted. I tried to teach modern OpenGL once and that turned into a math crash course pretty quickly so this time we'll constrain ourselves to 2D. ;)

I'm not going to use Java even if that's what the university is teaching. But other then that a low barrier of entry is key. So I've been thinking about using C# (with VS2013 as IDE) and the .Net port of SFML as a foundation layer for our students projects.

I have no prior experience with SFML but at first glance it looks like a good fit. But please help me make a decission faster: What do you think? ;)

Pages: [1]
anything