Change set 62837

Oct 9, 2011 at 5:29 AM

In a word: magic! I hadn't realised you'd already done the Name thing, or that you were converting it all to xaml. The result is great -- definitely the way to go.

Problems/bugs:

  • Name="" doesn't work in scene.xml, only in scene.xaml. Suggest you dump the xml format.
  • Position="" works, but Scale and Rotate don't.
  • Sample Navigation works (kinda weird, but), but sample Navigators just shows a plain grey screen.
  • scene.xaml has an error (but it mostly works anyway).

Error	7	A value of type 'ArrayExtension' cannot be added to a collection or dictionary of type 'DrawableModelPartContent[]'.	...\Samples\Content\Worlds\Scene.xaml	64	13	GameContent (Content)

Questions:

  1. Is it possible to nest objects? Transformable allows for a parent, but can it be set in xaml?
  2. Is it possible to add a non-drawable object in xaml? In code? That is, Transformable and Updateable but not Drawable.
  3. Are there any existing APIs in Nine to do rigid body animation by updating Transformables (or similar)?
Coordinator
Oct 9, 2011 at 5:37 AM
Name works in scene.xml, but use xml elements instead of attributes. <Name>MyWorld</Name>

The error is caused by the visual studio xaml designer, it doesn't affect the build process.

It is possible to nest objects using DisplayObject.

It is also possible to add non-drawble objects, lights and fog are not drawable objects.

The model animation will handle both rigid and skeleton animation, so just create a rigid model animation and play it the same way as skeleton animation.
Oct 9, 2011 at 9:31 AM
Edited Oct 9, 2011 at 11:59 PM

Thanks for that. Yes, I kind of realised, but Name'"" in the xml doesn't trigger an error, but it doesn't do anything either.

Q1: That works, but two problems. One is easy: DisplayObject has a Transform but no Position/Scale/Rotate. Hopefully you can fix that easily. The other is that it still doesn't make the cube a child of the teapot, so rotating the teapot would rotate the cube too. I know how to do it in code, but it would be nice in xaml too. Ideally any object could be a container.

Q2: Yes, I know about fog and lights, but I would like to add my own objects to the scene in xaml, and I can't see how to do that.

Q3: I'm not looking to play a play a pre-designed animation. I'm looking to manipulate objects in code along paths computed at runtime. I'm just asking if there is an API to help, or should I roll my own.

Q4: What does it mean: 'create a rigid model animation?'

FYI the xaml and Name make lots of interesting things possible. I'm just looking to push a few limits.

dy

Coordinator
Oct 10, 2011 at 5:16 AM
Q1: There are some bugs in DisplayObject and object hierarchies so thing may not work as expected. I choose not to allow all objects being a container because typically the scene graph is pretty flat.
Q2: You have to make your own class both Xaml friendly and Xna content pipeline friendly.
Q3: Then you have to manually update the transforms in code.


From: [email removed]
To: [email removed]
Date: Sun, 9 Oct 2011 02:31:48 -0700
Subject: Re: Change set 62837 [nine:275228]

From: dyork11
Thanks for that. Yes, I kind of realised, but Name'"" in the xml doesn't trigger an error, but it doesn't do anything either.
Q1: That works, but two problems. One is easy: DisplayObject has a Transform but no Position/Scale/Rotate. Hopefully you can fix that easily. The other is that it still doesn't make the cube a child of the teapot, so rotating the teapot would rotate the cube too. I know how to do it in code, but it would be nice in xaml too. Ideally any object could be a container.
Q2: Yes, I know about fog and lights, but I would like to add my own objects to the scene in xaml, and I can't see how to do that.
Q3: I'm not looking to play a play a pre-designed animation. I'm looking to manipulate objects in code along paths computed at runtime. I'm just asking if there is an API to help, or should I roll my own.
FYI the xaml and Name make lots of interesting things possible. I'm just looking to push a few limits.
dy
Read the full discussion online.
To add a post to this discussion, reply to this email (nine@discussions.codeplex.com)
To start a new discussion for this project, email nine@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com
Oct 13, 2011 at 4:20 AM

OK. I've been thinking about a camera as a scene object or attached to a scene object. If the camera inherits from Transformable it can provide its View simply by investing the AbsoluteTransform.

The code is trivial, but the maths to handle rotations and translations relative to itself or its parent/World gets complicated.

Any thoughts?

Oct 18, 2011 at 10:09 AM

Done. I now have a quaternion camera which inherits Transformable, which means it's convenient to place it using a Transform and convenient to rotate it using the quaternion. I have an Updater component to move it around, and a Controller component to accept user input.

I'm happy with that for now, although it still needs work. I learnt more than I wanted about the underlying maths.