The Calorie Density treatment has been progressing well and there will be a full “Part 3” posted later. In the meantime, I’m making a bit of an addendum to the previous post about realistically scaled models to explain the way this translates to research value a bit more.
In the previous post, I went in depth on HOW we’ve achieved a realistic sense of scale within the VR experience by modeling with a virtual ruler and essentially converting real world inches into virtual world “units”. Now I’m going to explain WHY we did that. This also draws a bit from the first part of these posts on the project where I talked about a script for calculating the volume of a mesh. By combining our realistic modeling and scaling with that volume calculator, we’ve basically been able to digitize the calorie density of these food items in a relatively accurate way. As such, we can actually pull off stuff like this image wherein different food items are calculated in their weight and calories in an accurate fashion, which will assist in demonstrating the way caloric density shifts between foods even in a virtual setting.
Take the piece of chicken for example. It was modeled based on a real world plastic replica of a chicken breast designed for dieticians to demonstrate these concepts. The piece was exactly 84 grams (3 oz). For the sake of this demonstration, we’ll go with the assumption that this cooked 3oz breast is about 150 calories (the value can shift based on cooking methods and other factors so for now we’ll just stick to a nice rounded answer). The plastic model was accurately recreated and scaled in the 3D environment. This doesn’t mean, however, that the actual volume of that piece is accurate to the volume of a real world piece of chicken. This is due to how Unity and the mesh volume calculation script work. They have their own measurement scale that everything else in the scene has been tailored to. As such, we have to do the same to figure out the weight and calories.
After putting the chicken breast through the volume calculator, we got a volume measurement of around 0.02 “cubic units” (the exact value is a longer decimal but we’ll round it for this explanation). Now, obviously this doesn’t really mean much on it’s own. We have very little frame of reference from this end. But as we know the opposite end, what weight and caloric value we are assigning to this object, we can actually work backwards and use a bit of math to figure out that all we really need is a multiplying factor of density that can be derived from the weight goal.
Density is mass/volume, thus mass = density*volume.
Weight is mass*gravity, thus Weight = density*volume*gravity. In our scene, gravity is a constant so we can just assume that as a 1 for the sake of this multiplication.
So if we give the virtual food a density to balance the weird volume output, we can get the accurate weight applied and things balance out.
To accomplish this, we can take our known volume and desired weight and find the adjusted density needed from density = weight/volume.
For example, with the chicken that came out as 0.02 volume and should weigh 84 grams in the scene, we take 84/0.02 and get a density of 4,200. In this case, our unit would actually turn out to be something like “gram per cubic unit” which sounds strange and the density itself is very large. But that all comes form the oddity of the “cubic unit” where we don’t have a clear frame of reference. What this bit of math does for us basically lets us convert that vague volume measurement into exactly what we need to get the realistic gram measurement of our chicken.
Now, say that we cut the virtual chicken in any way. We have no way of knowing exactly how much these theoretical new chicken chunks weigh in grams, but we know that the density of the chicken remained the same. So if we just use the volume calculation script again for these new pieces and apply the same density factor as multiplication, we can actually get a fairly accurate representation of the weight of these new pieces. For example, if we cut off a small piece of the breast that the volume calculator reads out as 0.008 cubic units, we could use the 4200 density factor from before and see that that piece is approximately 33.6 grams (1.2oz). From any meaningfully accurate measurement of grams of these food pieces, we can apply a simple real world measurement of that food’s caloric density, calories per gram, to them to get a realistic measure of this virtual food’s calories. If 3oz of chicken is 150 calories, then 1.2oz of chicken is about 60 calories.
This is pretty much just showing our work to come out with a simple answer of “multiply the mesh volume by some factor to simulate real world weight”, but it is important to lay out the thought process and make sure it’s clear when dealing with an academic subject like this. I hope this makes it clear how we’re taking even steps like these to ensure that the VR treatment is kept to accurate scales and calculations for the sake of making the transition of virtual learning to real world application as smooth as possible. In the next major update post I’ll be going over the progress in bringing all these pieces together to start to form the experience fully while also starting our explorations into user interface for the experience.
Leave a Reply