pat wrote:I added a tet to the applet.
My initial thought on the rotating the projection was that you could accomplish the same thing with just the first mouse button. But, that's incorrect. You want to see things from other angles but still have the surfaces removed as from the original angle. I can understand that.
I didn't get to implementing that yet though. I'll move that to the third mouse button and make a slider for scaling.
pat wrote:Okay, I've changed the third mouse button to move just the displayed projection. I had it snap back as soon as you release the button though. Without that, it got too confusing to figure out how things moved when you again used the first mouse button.
I added a scroll bar on the side to allow one to scale the shape. This is now just scaling rather than moving closer to the object, so the clipping artifacts from before should be gone.
And, I included the source code in the JAR file and linked to the JAR file at the bottom of the page. [...]
pat wrote:The square in the initial projection is actually a cube... the only visible facet's vertexes are: < -1, ±1, ±1, ±1 > But, in the projection from 4-d down to 3-d, the points < -1, a, b, +1 > and < -1, a, b, -1 > are getting mapped to the same point in 3-d. I'm open to suggestions. I am using the point's 4-d coordinates: < x, y, z, w > where x is into the screen and doing the projection down to 3-d by just lopping off the w. Do you think I should do a sort of perspective truncation?
To go from 3-d to 2-d, I do: x' = y / x, and y' = z / x. Should I do something similar from 4-d to 3-d? Should I do: x' = x / w, y' = y / w, z' = z / w? and then go on to project from 3-d down to 2-d? Does that make any real geometric sense?
As for why they are not convex, these are not projections of 4-d polytopes. These are projections of *some* 3-d facets of a 4-d polytope. I don't expect them to be convex.
quickfur wrote:Ahhh I see, so essentially you're using a parallel projection then? I had perspective projection in mind, at least from 4D to 3D. But this is still a bit odd, because if only one facet (cell) is visible, and the vertices all lie on the same projected plane, that means our view angle must be looking at the facet edge-on.
Another way to put this is, if a given facet of the tetracube is obscuring our view of all other facets, then it must lie on the 3D hyperplane orthogonal to our line-of-sight (or close to orthogonal). But if this is so, then the facet should be projected to an (almost) identical volume in the realmar retina.
As for why they are not convex, these are not projections of 4-d polytopes. These are projections of *some* 3-d facets of a 4-d polytope. I don't expect them to be convex.
Right, but we picked these facets so that they happen to be the ones that lie along our line-of-sight. I don't see how this would lead to a concave set of facets, since in the analogous 3D case, there's no view angle from which a 3D cube would project onto a concave area. (Or am I carrying dimensional analogy too far?)
pat wrote:And, it's just the way that I projected it that is keeping it from being that way. But, the problem is that I cannot see any geometrically consistent way to do otherwise.
pat wrote:[...]Take for example viewing a square in Flatland and that the square really just sticks through Flatland, but you want to project it down to Flatland. If two sides of the square are perpendicular to your plane and your line of sight goes through the center of the square, then two points will get projected down to your plane to the same point... and the other two points will get projected down to another point.
[...]We picked the facets to be the ones visible from a particular viewpoint. I'm not sure that's the same as the facets along a particular line of sight as I'm not sure what you mean by that.
The proper analogy here, I believe is more like this. Imagine that you're along the x-axis somewhere looking back at the origin. There's a cube at the origin. You are looking directly at one corner of the cube. You can see three faces of the cube. Now, imagine if you took a light off down the y-axis somewhere and pointed it at the cube. Further, imagine that only the three faces of the cube that you can see will project a shadow. Would you expect that shadow to be convex? I wouldn't. I would expect it to be concave.
pat wrote:Okay, at the bottom of the page, I've got that sort of thing now. The page is: http://www.nklein.com/products/hsr.
Maybe I'll integrate both into the applet some time.
And, yes... for what it's worth, I would expect these projections to be convex. But, they also are more confusing to look at than I had expected. Hmm....
pat wrote:Actually, what I had there was wrong... I was technically assuming that you were in one position for purposes of clipping and in another position altogether for display. The version that's there now (at the bottom of the page) is much better.
The version at the top of the page has the x-axis going into the screen, the y-axis going to the left, the z-axis going up, and the w-axis going the other way while clipping is done as if you were along the negative x-axis.
The version at the bottom of the page has the w-axis going into the screen, the y-axis going to the left, the z-axis going up, and the x-axis not displayed at all while clipping is done as if you were along the negative x-axis.
There are some slightly concave things going on here, but I feel like that is just an artifact cause by there being a single viewpoint rather than the view being a parallel projection. I think, if it were parallel projection, you would get to see a couple of more vertexes which would fill out the shape. Those extra vertexes appear when you rotate further, but don't show for small rotations in only one plane.
pat wrote:Well, adding new polytopes is a matter of adding the correct vertexes and the correct hyperplanes and making sure the code that checks for hyperplane intersection checks the right planes.
With the Cube and the Tet there were lots of shortcuts available. I've been wanting to add the cross-polytope (16-cell). With the code there already, it would be easy to get all of the hyperplanes and vertexes in for that one. But, the intersection code wouldn't suffice. But, if I write general enough intersection code for the 16-cell, adding other polytopes should be easy.
pat wrote:Alright... I added the 16-cell. So, if you know the vertexes and hyperplanes of the 24-cell and how to tell which vertexes share an edge, then you should be able to swipe the intersecs() code from the CrossPolytope.
pat wrote:No, I didn't change the clipping on the cube at all. For a short time, I changed the clipping on the Tet to be the same as I made for the 16-cell to verify that it worked as I expected. But, I never touched the cube code and I didn't change the view code.
I've not seen anything I didn't expect in the cube. If I am looking at a corner of the hypercube, I would expect to see four of the eight cells. I've never seen more than four cells at a time in the hypercube. And, most of the time, I'm seeing three. Everything that I've seen seems consistent with the number of cells one would expect to see per edge across all of the polytopes---I think.
Can you show me a screen shot... or describe very precisely what dragging you did that results in something you think weird.
quickfur wrote:As far as the 24 cell goes, I know the vertices and the edges. For isEdge(), I thought of using the property that the dot product of the endpoints of all edges is 2. However, this is also true of other pairs of vertices that don't share an edge. The distance of all vertices from the origin are also identical (cool property I didn't realize before!), so i'm not sure how to tell them apart.
quickfur wrote:Now, I actually have a copy of the code for the previous version; diffing it shows several changes in View.draw(): the pov has changed from (0, -offset, 0, -dist) to (-dist, -offset, 0,0), and there are a couple of changes in the computation of p1, px1, p2, and px2. I haven't looked more closely yet to see how this is affecting the results, though.
quickfur wrote:Actually, the initial (reset) view is already a bit weird. In the previous version, the initial view shows the square face of a cube, which you can tell is a cube by rotating it with the 1st or 3rd mouse buttons. But now, it shows 4 cubes instead, including the outer and inner cubes.
pat wrote:quickfur wrote:Actually, the initial (reset) view is already a bit weird. In the previous version, the initial view shows the square face of a cube, which you can tell is a cube by rotating it with the 1st or 3rd mouse buttons. But now, it shows 4 cubes instead, including the outer and inner cubes.
Hmmm... it doesn't show 4 cubes for me. If I 'reset' and then use only the third mouse button (to rotate only the retina, not my position w.r.t. the hypercube), I only see one cube. In the initial view (before touching the mouse button), I see one cube in perspective.
pat wrote:I have flushed my browser cache and restarted the browser. And, I get the same results whether I run the applet in Safari or the java appletviewer.
[...]
And, when I rotate it (with the third mouse button), it's just a single cube.
quickfur wrote:Anyway, I've added the 24-cell, but I can't seem to get the bounding hyperplanes right, 'cos intersects() always returns false. Do you have any idea what I'm doing wrong? I'm pretty sure the points I pass to the Plane4D constructor are correct. Here's my testing version of the applet. I added a checkbox to enable/disable clipping (hidden cell removal) so that I can tell whether the 24-cell projection is right. (It's rather hard to tell just by looking at the lines :-)) Currently, it's wrong. :-(
pat wrote:[...]Ahh, the change from ( 0, -offset, 0, -dist ) to ( -dist, -offset, 0, 0 ) is important. It should be the latter. If it's the former, then the clipping is happening from a different point of view than the display.
And, there was one point where I was not doing any sort of perspective with the w-coordinate. So, you were seeing an orthogonal projection of the cube. If that makes more sense, I can go back to that. But, I thought that the stereo-pair worked better with the perspective projection.
quickfur wrote:Although, it just occurred to me that this might be because the viewpoint is on the positive X axis but the clipping is done w.r.t. to the negative X axis?
Because, I notice that, starting from the initial configuration and rotating it with the 1st mouse button, the "inner cube" is visible but the "outer cube" isn't.
pat wrote:[...]I think you're misinterpreting what's going on there. If you rotate with the third mouse button, you'll see that what you're seeing is a cube. If you rotate with the first mouse button slightly so that you get two facets in view and then rotate with the third mouse button, you'll see that you've got two facets which share a face. Then, if you rotate another direction with the first mouse button until you've got three facets showing... when you switch to the third mouse button (which only rotates the retina, not the point of clipping), you'll see that what you've got is three cubes which all share an edge. Then, if you rotate with the first button until a vertex is just about in the center and then rotate with the second mouse button a tiny bit, then with the third mouse button you can verify that you're seeing four cubical facets which all share a vertex.
Return to Where Should I Post This?
Users browsing this forum: No registered users and 11 guests