Saturday, 5 November 2011

Gizmo update coming soon!

Hi guys, just wanted to let every XNA3DGizmo user know that a update is currently being developed. I noticed that the original implementation had some sloppy shortcuts that could make it more difficult to implement if you were unfamiliar with the code. This included references to the Engine class among other things.

So I decided to improve things by removing any reference to outside classes (including InputState which is no longer required) I realized this update is necessary as even I found it difficult to implement the gizmo in a new project and wasn't a simple drag&drop operation as it should be (or as close as possible to it) this made it obvious some improvements were required to the public version.

The last public update was quite a while back and I was using a modified version with already several improvements implemented (such as multiple type of objects you can select as shown in the Vertex Manipulation Video where I select both scene objects and vertices with the same Gizmo component)


So in general the upcoming update should make it much easier for everyone to implement this gizmo into his own code/editor. If you had trouble integrating it, please let me know. There is no current ETA on therelease, but I'll try to do it sooner than later...

10 comments:

  1. I saw your commit, nice work, waiting for more nice features :)

    ReplyDelete
  2. I think you've missed some files during commit, please check better.

    ReplyDelete
  3. Yes, there was a problem with the SVN setup. I noticed this today on my laptop (original development is on my PC) so I can fix this tonight.

    Further tasks are mostly testing and compiling a release package for Codeplex.

    ReplyDelete
  4. Hi Tom,
    It seems I have some issue (version 1.0)with re-selecting the a cube when I'm moving the camera. I am selecting one of the cubes and then deselecting by clicking outside. I am moving the camera position (let say Engine.CameraPosition= new Vector(200,50,50)) in the Update method and I am trying to select the same cube. If I don’t click on the place where the cube was (on the screen) it is not possible. Any idea what I am doing wrong?

    ReplyDelete
  5. I think you forgot to update your View matrix. After updating your position you must update your view matrix accordingly. i.e:
    Engine.View = Matrix.CreateLookAt(Engine.CameraPosition, Vector3.Zero, Vector3.Up);

    I have significantly reduced the integration complexity in the upcoming release. I have noticed the current v1.0 can be a bit difficult to implement if you're unfamiliar with the code.

    ReplyDelete
  6. Hi Tom,
    Thank you for your prompt response. Consider the following modification in your Update function (version 1.0):
    protected override void Update(GameTime gameTime)
    {
    k++;// added line (initialised as int)
    if (k > 1500) k = 1500;// added line
    Engine.CameraPosition = new Vector3(-5 +(k/10), 50 , 50);// modified line
    When you run this we will have slowly moving cubes. Click on the bottom cube while it is moving (bottom of the screen in the middle) and then click outside so the gizmo will disappear. If you wait until the ‘animation’ stops and try to select the same cube you will only be able to do this if you click where the cube was.
    If you look in the code the next line after the above 3 lines is Engine.View=… and Engine.Projection=… .Am I missing something? Thanks in advance

    ReplyDelete
  7. I will have a look at this in the morning :) There could be something wrong with the old ray collision code.

    ReplyDelete
  8. I think I've found your bug. (or atleast a bug) This no longer happens in the new beta release (but that is still an early beta with many breaking changes for your integration so the below fix is easier for you now)

    A quick walkthrough to fix this locally for you:
    * Open GizmoComponent.cs
    * look for the Update(GameTime gameTime) function.
    * move the following lines from update:
    this.view = Engine.View;
    this.projection = Engine.Projection;
    to the very top of the update function, above:
    if (!Enabled)
    return;
    this was causing selection issues where you would use outdated view/projection to select objects.

    ReplyDelete
  9. Thank you Tom,
    This is working for me. I appreciate your effort and wish you all the best with the new release. Your Gizmo is really very well designed and I am sure it will benefit the XNA community.

    ReplyDelete
  10. Thank you. Good luck with your editor, make sure you take a look at the new and improved release once it's out of beta ;)

    ReplyDelete