Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: ben_g on November 13, 2013, 04:39:47 pm

Title: [axe] GLib model editor (WIP)
Post by: ben_g on November 13, 2013, 04:39:47 pm
About the poll:
The poll is to decide what would be the best graphical style. These are the screenshots:
'old' b&w graphics'new' grayscale graphics
(http://www.omnimaga.org/index.php?action=dlattach;topic=17452.0;attach=16348;image)(http://www.omnimaga.org/index.php?action=dlattach;topic=17452.0;attach=16410;image)

Original post:

Hi,

As you might know, Themachine created a great axe library to make 3D things in axe.

While he is working on making his lib easyer to use, creating models with it is still rather inconvenient, as it requires you to fill in the raw point data. This is fine for a cube, but for anything more complex, it can help to have a more visual way of doing it.

That is why I started working on a simple model editor. For now, it can only add vertices and move them, but I plan on adding more funtionality as soon as more tutorials are available. The planned functionalities are connecting vertices by lines and polygons and exporting models <format not yet planned>. If you have suggestions for what to add, please post.

There isn't much more I can say about it yet, but I do have a screenshot of it in action:
Title: Re: [axe] GLib model editor (WIP)
Post by: Matrefeytontias on November 13, 2013, 04:49:20 pm
Looks amazing :D It shows the power of GLib too, as this is very fast. Can't wait to see what you'll come at with it !
Title: Re: [axe] GLib model editor (WIP)
Post by: Streetwalrus on November 14, 2013, 05:21:00 am
Yup, seems pretty cool. Interesting way of showing the depth of the crosshair too.
Title: Re: [axe] GLib model editor (WIP)
Post by: Sorunome on November 14, 2013, 10:47:22 am
wow, yeah, that is looking truley amazing! :D
Title: Re: [axe] GLib model editor (WIP)
Post by: TheMachine02 on November 14, 2013, 01:06:00 pm
Yup look super cool  :P  One of the first prog created with Glib
/me is happy  :love:
Title: Re: [axe] GLib model editor (WIP)
Post by: ben_g on November 24, 2013, 04:21:58 pm
I haven't been able to work on this for a while because of some windows-related problems, but they are partially fixed now (windows still often crashes, causes random and quite heavy slowdowns, and there are still a few more problems) but at least wabbitemu works again, which means that I can work on this again.

There aren't really any new features yet, but I slightely changed the graphics of the vertex move mode. Now it greys out the unselected vertices and the cursor which makes the selected vertex more visible. However, it does slightely slow down the program.

Lines will be added soon, but I first want to know what would be the graphics: The current ones of the 'old' ones. I'll add a poll for that.
Here's a screenshot of the new graphics:
Title: Re: [axe] GLib model editor (WIP)
Post by: Keoni29 on November 24, 2013, 04:55:44 pm
Make the Arwing from Starfox!
Title: Re: [axe] GLib model editor (WIP)
Post by: ben_g on December 03, 2013, 04:37:50 pm
It's a bit too early to do that, because it now only supports points.

I did add a new feature, though: it can now also delete points (I kinda forgot this).

Further, I have decided to release the source code for this program, in case someone wants to learn from it (attached to this post, compile with the latest version of GLIB and axe).

PS: It would be nice too see more votes in the poll, so I know on what I should base the line drawing interface. (which will require you to select two points and it'll add a line inbetween)
Title: Re: [axe] GLib model editor (WIP)
Post by: Matrefeytontias on December 03, 2013, 04:57:22 pm
I don't think grey is that useful since the cursor is already on the selected vertex.
Title: Re: [axe] GLib model editor (WIP)
Post by: ZippyDee on December 04, 2013, 02:53:34 am
What might be useful is to instead gray the cursor so that the point is more visible. Right now the cursor covers the point and makes it difficult to tell exactly where it is, especially at higher depths relative to the camera. If you had a way to gray out the cursor and draw the selected point over it in black then the point might be much easier to see.
Title: Re: [axe] GLib model editor (WIP)
Post by: ben_g on December 04, 2013, 08:21:25 am
What might be useful is to instead gray the cursor so that the point is more visible. Right now the cursor covers the point and makes it difficult to tell exactly where it is, especially at higher depths relative to the camera. If you had a way to gray out the cursor and draw the selected point over it in black then the point might be much easier to see.
graying out the cursor is done in the grayscale version, so do you want a combination of the two where the vertices stay black but the cursor is gray?

When I add line drawing or selecting multiple vertices, would you prefer the points to stay black and the selection being indicated by multiple gray cursors? Or add gray cursors to the selected points, maybe with the real cursor being black, or do you prefer to have it all in b&w?
Title: Re: [axe] GLib model editor (WIP)
Post by: ben_g on December 05, 2013, 02:48:55 pm
It's possible to draw lines now,  so I decided to attempt to create something with it:
Make the Arwing from Starfox!
(http://lh3.ggpht.com/-jLzGMO-2BM8/UdR6CVDl-OI/AAAAAAAAB9E/CC3al8qCk2k/Challenge_accepted.png)

btw: the arwing, while fully modelled, is still displayed at 25fps on 8MHz.
Title: Re: [axe] GLib model editor (WIP)
Post by: Matrefeytontias on December 05, 2013, 03:40:18 pm
Awesome :D sure shows how good both your program and GLib are :D
Title: Re: [axe] GLib model editor (WIP)
Post by: Streetwalrus on December 05, 2013, 03:57:54 pm
Holy crap, this thing keeps being awesome. O.O Also 8MHz doesn't exist on our calcs. :P
Title: Re: [axe] GLib model editor (WIP)
Post by: Sorunome on December 05, 2013, 04:39:02 pm
wha, that is awesome O.O

And i guess you mean 6MHZ? :P
Title: Re: [axe] GLib model editor (WIP)
Post by: ZippyDee on December 05, 2013, 08:35:03 pm
graying out the cursor is done in the grayscale version, so do you want a combination of the two where the vertices stay black but the cursor is gray?

When I add line drawing or selecting multiple vertices, would you prefer the points to stay black and the selection being indicated by multiple gray cursors? Or add gray cursors to the selected points, maybe with the real cursor being black, or do you prefer to have it all in b&w?

Yes, I'd say vertices stay black but cursor is gray, and then in multiple vertex selection I'd say either multiple gray cursors, or do the opposite and have one of them be gray point on a black cursor. It's just the contrast so that you can see the actual position of the point without the cursor getting in the way. It's totally functional the other way as well, it's mostly an issue with the further points where the length of the cursor lines are shorter.

It definitely looks great there in that Arwing video. Having everything in the model be black makes it a lot easier to see what you're doing and what you're working with.

I guess the next step is opaque polygons :O
Title: Re: [axe] GLib model editor (WIP)
Post by: TheMachine02 on December 06, 2013, 01:06:33 pm
indeed, this is pretty awesome. Cursor is good like this  :P

I guess the next step is opaque polygons :O

Ouch it's true I need to finish this part  XD
Title: Re: [axe] GLib model editor (WIP)
Post by: ZippyDee on December 06, 2013, 01:13:22 pm
Heh well I guess the first step is triangulation, THEN opaque triangles.

Do you have any ideas on how you're going to specify triangles? I feel like the user would manually select a triangle by choosing the three vertices, and THAT's when the model should be gray. Points and edges would turn black once selected. Maybe you can use like a gray-black flashing cursor or something for that drawing so that it contrasts with both the gray and the black models.

The fact is that you'll almost definitely want user-selected triangles, rather than having to write any triangulation routines for arbitrary polygon selections (which would be a total bitch to write). You COULD write some triangulation routines, but I wouldn't recommend it.
Title: Re: [axe] GLib model editor (WIP)
Post by: TheMachine02 on December 06, 2013, 01:23:27 pm
GLib should normaly be able to handle triangle / quadrilateral thing. However, for quadri the point need to be enter clockwise or anti-clockwise  :P Guess triangulation should'nt be usefull. There is some sort of sphere too.
Title: Re: Re: [axe] GLib model editor (WIP)
Post by: DJ Omnimaga on December 06, 2013, 06:28:45 pm
Darn, that is impressive O.O. I am glad this also runs pretty fast.
Title: Re: [axe] GLib model editor (WIP)
Post by: TheMachine02 on December 07, 2013, 06:30:45 am
I am glad this also runs pretty fast.

me too
/me run
The speed drop will be however significant with filled polygon  :P  I will soon release the poly lib as well as some new tuto, but there will be no backface culling / nor texture for the moment.