View previous topic :: View next topic |
Author |
Message |
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Mon Apr 12, 2010 4:08 pm Post subject: Local coordinate systems. |
|
|
Hi all,
DeleD has no local coordinates per object. Everything is defined in world space. Allthough this is something that makes DeleD easy to use, it's also a big problem for game-developers. I'll illustrate my problem here:
When I was working on TubeRunner, I made two DeleD plugins. One could generate track segments which could be modified with DeleD. The other one could take all track-segments and move/bend them to make the entire track.
So I had a scene containing a number of prefab segments, and the actual track.
The problem was that I needed to align the segments with eachother while generating the curve. Because the segments were all located "somewhere" in world-space, I needed a way to transform their coordinates to their own local space first, before adding a segment to the track. This was my biggest problem. There is no reliable way of doing this.
First, I computed the box that contained all vertices of one segment. I used the center of this box as the center of the segment. But when the segment had an irregular shape, this center would not be the desired center and the segment would not be alligned to the rest of the track.
After this failure, I let my plugin generate one extra vertex (with Index=0) that denoted the center of the segment-model. This works, until you accidently do something with your mesh that deletes or moves this vertex. In that case, your segment is worthless and you have to start all over.
Because I won the competition, I will be sponsored for the IGF. I will make a better version of my game and I would like to use DeleD for the race-track. However, I forsee that this will be a HUGE problem again.
Can someone comment on this? Are there possible ways to work around it? Should we add local-coordinate spaces in DeleD? If yes, how could we do this best?
Thanks. |
|
Back to top |
|
|
AWM Mars Member
Joined: 06 Jan 2010 Posts: 1195 Location: Wilts England
|
Posted: Mon Apr 12, 2010 4:27 pm Post subject: |
|
|
This may sound mute, but here goes.
Is it not possible to use some sort of snap feature that would do edge detection. Thats an assumption that the track is all the same width at the connecting points. I can see a flaw should you use rotate to create inclines etc.. meaning greater work.
Brain Hump Version 2
When I was using AutoCad, I could set/move/attach, to given coordinates, or points/edges of existing parts of the drawing, then use that as a temp 0,0,0, locator from which to snap child dependant drawing items, grouped or ungrouped. Maybe you could have a floating Gizmo that can be attached to a point, rotated etc that would be the locator for 'local work'. Moved as the work progressed. _________________ Politeness is priceless when received, cost nothing to own or give, yet some cannot afford.
Checkout:
http://www.awm.mars.yourinside.com/
http://www.bccservices.co.uk
http://www.localtradecheck.co.uk |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Mon Apr 12, 2010 4:48 pm Post subject: |
|
|
This has been a big issue I always had to grapple with too (and still am). Most of the time I would work with individual objects centered about the origin (or wherever their center "should" be) and combine things later in the engine. In the engine's scene graph, the model would be attached to the node, which handles all the transformations.
I think DeleD really needs to keep track of this, as it does lend itself to some other commonly requested features such as pivots and scene graph functionality. |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Mon Apr 12, 2010 6:32 pm Post subject: |
|
|
@AWM Mars: I don't really understand your first idea. The second idea about a locator that can be moved is quite nice, but I'm still unsure how to integrate this in DeleD. I don't feel like introducing yet another "edit mode" to edit these locators.
@Starnick: Glad you're with me.
The problem of this idea is that it breaks backwards compatibility as we have to change the DXS layout. We still want to be able to load the old DXS stuff. The saving routine will probably be modified permanently so that all new saved files will contain the matrices.
Also, we have to think about the plugins. It would be great if we could keep that interface the same for now. The downside is that plugins can't make use of this new feature.
This is not something I'll start working on right now. First I'll focus on path functionality. If that's done, I'll try to assess things and maybe start on an implementation. |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Mon Apr 12, 2010 6:46 pm Post subject: |
|
|
chronozphere wrote: |
@AWM Mars: I don't really understand your first idea. The second idea about a locator that can be moved is quite nice, but I'm still unsure how to integrate this in DeleD. I don't feel like introducing yet another "edit mode" to edit these locators.
@Starnick: Glad you're with me.
The problem of this idea is that it breaks backwards compatibility as we have to change the DXS layout. We still want to be able to load the old DXS stuff. The saving routine will probably be modified permanently so that all new saved files will contain the matrices.
Also, we have to think about the plugins. It would be great if we could keep that interface the same for now. The downside is that plugins can't make use of this new feature.
This is not something I'll start working on right now. First I'll focus on path functionality. If that's done, I'll try to assess things and maybe start on an implementation. |
Yeah, I figured as much for the DXS format. But there may be ways around that (e.g. have a new format version, loader for the old one, convert to the new internal format, etc etc).
I think such an endevour though would probably be a part of something much larger, though. If you're going to break the old format, you might as well break a few other things (such as the plugin interface). Maybe also some major refactoring to improve and make clean internal systems so it'll be a lot easier to make big enhancements in the future.
All of this should be of course, a major version change with the motto:
"If you break it, break it good.
Backward compatibility is great, except for when it holds you back. Granted, with such a small team size this may not exactly be the most doable thing either. |
|
Back to top |
|
|
fik Member
Joined: 11 Oct 2006 Posts: 303
|
Posted: Mon Apr 12, 2010 7:25 pm Post subject: |
|
|
I think having a object 'origin' to enable object local information to be calculated is what you are after. This would not have to break the file format as loader can be changed to apply one if not there in older files.
As to your problem with having objects verts stored as local reference would mean major changes would be needed to almost everything.
The way Starnick suggest's is the way you have to export most models from even high end progs to import to game engines like UT3 etc.
I have always found that having a reference object for the edges which need to join as the way to go then snapping verts to the verts of a copy of this.
Yes snapping in Deled needs some changes to make this eaiser but it is possible now using target weld.
I have started work a while back on adding a origin object to a mesh but not very far with it yet. |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Mon Apr 12, 2010 9:13 pm Post subject: |
|
|
fik wrote: |
The way Starnick suggest's is the way you have to export most models from even high end progs to import to game engines like UT3 etc.
|
That as well as having a skeleton for the model (even for non-biped stuff like tanks, turrets, etc).
Although, I know that in Maya you're able to group things in a tree-like fashion (whether there's logical nodes or not I can't say for certain as I only work indirectly with maya). |
|
Back to top |
|
|
adr Member
Joined: 23 Jul 2005 Posts: 165
|
Posted: Fri Apr 16, 2010 2:17 am Post subject: |
|
|
I would also like the local location, too. I don't think you would need a super new window for it either. Just have it parent to the node you want to give it... Maybe in the object screen have a "local or world" option-- under that, have a poisition box for where you like to have its org. poisition/center point. |
|
Back to top |
|
|
Starnick DeleD PRO user
Joined: 28 Jul 2007 Posts: 611
|
Posted: Fri Apr 16, 2010 1:58 pm Post subject: |
|
|
adr wrote: |
I would also like the local location, too. I don't think you would need a super new window for it either. Just have it parent to the node you want to give it... Maybe in the object screen have a "local or world" option-- under that, have a poisition box for where you like to have its org. poisition/center point. |
No you wouldn't need a new window per say (unless if you want to perhaps offset it, ala a pivot point, then that would actually be creating a node as you mention), but its more of a problem with internal and file representation from what I understand. |
|
Back to top |
|
|
chronozphere DeleD PRO user
Joined: 20 Jun 2006 Posts: 1010 Location: Netherlands
|
Posted: Fri Apr 16, 2010 3:45 pm Post subject: |
|
|
Hmm... I think fik's idea is quite interesting. Adding some kind of object origin that has Location, and 3 vectors describing the orientation. I quite like that.
It could be easily added to the DXS. We just leave all vertices in world coordinates and add a <locator> or <origin> section that contains these vectors. Internally, we could transform vertices to local space, only if we need this.
This origin can be usefull in a few tools, especially Rotate.
We do need a way to move/rotate this origin without moving/rotating the entire object along with it. Also, it would be nice if we could quickly "reset" the gizmo so that it is located at the center of an object again. |
|
Back to top |
|
|
|