I have a set of models generated from scientific data that I'm rendering using Threejs. The models are transparent and have internal shells that are a part of the mesh but not connected to the exterior/main shell.
If you view the models from the right side all of the internal shells are rendered and everything looks great (see second image). However, if you slowly rotate from left to right you can see tris progressively disappear (see the first image).
Why is this happening and how can I fix it?
Related
I am displaying a number of different models simultaneously in three.
Some models have the same texture, and it can make it hard to tell where one starts and another ends.
As an example, first image is from my three viewer, second image is from Blender:
It is not obvious in three where the two objects intersect.
I've so far attempted to alter lighting and material settings but have been without success on that front.
I also tried an outline post processing effect but due to what I think is a disorderly output from Sketchup (where the models were made) the outline effect is chaotic:
I am trying to find a good way to clearly delineate between models.
Raycaster from mouse position. De-emphasize the other models' opacity or something. Or if you're serious, you could try the clipping stencil. There's some really good examples for mesh BVH that demonstrates this. https://gkjohnson.github.io/three-mesh-bvh/example/bundle/clippedEdges.html
I'm trying to create a moveable 3D-view in three.js on top of a static 2D-rectangle image. Everything works fine, but I want the buildings at the upper edge to be "cut off" vertically so they appear to be placed visually correct on top of the static ground rectangle. Here are some pictures to illustrate the problem:
Desired appearance (only top of building is over the edge)
Wrong appearance (bottom of building floating over the edge)
So I want some kind of cut-off that slices the objects vertically at the top edge, however I'm unsure what the best method would be, I tried frustrum culling and putting the scene inside of a cube, but both of these didn't really work.
If that's not possible the next best solution might be to exclude objects that touch the edge from rendering completely, or what do you think?
I figured it out, apparently what i want is called "Clipping Planes" and three.js supports those natively. Sorry for the somewhat confusingly worded question.
I'm using threejs (R68) on the model online view project which converts some uploaded models to threejs files.
We found some models look incorrect as below.
Some models can be viewed at
http://www.threedbook.com/detail/23981
Especially when move the models(rotate or pan), the mesh color and shade look changing all the time.
Strange thing is that model will look normal if it's zoomed in enough size.
Would anyone point me which causes the rendering problem? or any issue when I convert the models to threejs file?
Thanks a lot!
The modelling of the object is incorrect. You have overlapping polygons over the same area and very close to each other. When rendering, that would cause the appearance to change (specially if you are zoomed out since you dont have enough rendering resolution); ie. many polygons are squashed on top of each other and the renderer doesn't know which one to render first. When you zoom in, everything is ok because now you have the resolution.
I find the similar issue at Flickering planes
I make the near to 1, it works for most models.
I am using Unity3D, and I have a function which is being called inside of OnGUI to lay out the various gui components of my application. Ordinarily, the labels and buttons are all inside of a certain Rect that I supply, which is centered on the screen.
No problem there... however, what I want to is sometime render the exact same gui elements, which can be dynamic, and thus not just put into a prefabbed texture, into a trapezoid-shaped area off to the side, looking as if that gui were actually on a flat plane, pushed away from the center of the screen, and rotated slightly. All gui buttons that were drawn in the function should still respond normally.
I was rather hoping I could just specify some values in GUI.matrix to map the rectangle to a trapezoid, but my initial exploration seems to show that the gui elements don't appear to use homogenous coordinates, and everything still shows up as rectangular.
Is there any way to do this with Unity, ideally without requiring access to pro-only features?
Since now Unity3D GUI system isn't very flexible. The new GUI system is one of the features still not released in Unity 4 (we are all waiting for it).
From my point of view it has several problems, particularly:
You are forced to layout components using the flow of the code, instead of having a more declarative (or at least a more structured) way to do that.
It's quite inefficient (at least one draw call for button).
It isn't flexible at all. Add, Remove, Enable/Disable buttons can be come quick a painful operation when the number of buttons increase.
however, what I want to is sometime render the exact same gui
elements, which can be dynamic, and thus not just put into a prefabbed
texture, into a trapezoid-shaped area off to the side, looking as if
that gui were actually on a flat plane, pushed away from the center of
the screen, and rotated slightly. All gui buttons that were drawn in
the function should still respond normally.
This is quite hard if not impossible to obtain using Unity's GUI classes.
I see 2 possibilities:
Don't use GUI classes to do that. If your GUI is simple enough, you can implement your own (even 3d) buttons using for example:
A mesh (a plane or a trapezoid mesh) with a texture for the button background
TextMesh for drawing 3D text
RayCasting to check if a button has been pressed
Use a library that implements a more advanced GUI system like NGUI
When I ran into the same problem, I just used normal 3D GameObjects cubes with textures and called OnMouseDown(PC/Mac) or RayCasting(Android/iOS) on them. I guess that's how everyone does it.
I currently have a FBX animation model of a biped moving slightly forward (positive Z axis), turning around 180 degrees, and starting to run in the opposite direction (negative Z axis).
However, I would like to completely mirror such animation, in other words, start heading the negative Z axis, and the turning forward the positive Z axis. This, preferably through 3dsMax.
I know what you must be thinking, "Why the hell doesn't he just rotate the transform component/object of his animation character??". Well, unfortunately the current code I am working on depends that the characters movement should be independent of the actual animation, among other limitations.
Apparently, according to our 3d designer here, there is no trivial "Rotate Animation" option in 3dsMax (does that check?), so I am looking for possible scripts that could help me out. Anyone ever heard of such solution? Thanks in advance.
Create a dummy aligned to the root of your model.
Link the root of the model to that dummy.
With only the dummy selected, click the mirror button on the maintoolbar.
This will create a mirror image of the bones along with the animation on those bones. The only caveat is the names of the bones will also be mirrored. eg. the arm called 'right_arm' is now now on the left side.
If you need to preserve the animations to the original bones, look into using the animation mixer. This allows loading and saving animations onto characters. But it also has object mapping feature that allows objects of different names to load on saved animations.
So create a mapping. Save the mirrored animation. And load it back onto the original bones with that mapping.