As the image shows, my 3D Text keeps disappearing from my scene when I click Play, and then when I zoom in, this is what I see.
When I exit the Play scene, it stays like that till I Ctrl+S and Save on which is returns to its proper text form.
Is there something I don't know? This happens even when I deploy my app ona device. These words are never seen because of this.
Using:
Unity 5.0.3p1 (32bit)
But I've had this problem with all version starting from Unity 4.x
My Hierarchy:
Your problem is having a MeshFilter on the same GameObject as your TextMesh
What you are seeing is the MeshRenderer drawing the wrong mesh, but using the font's material. Those seemingly random letters is what a font texture atlas actually looks like when textured on a cube. What mesh is chosen might as well be random, and with bad luck this kind of things might go undetected on the editor but show up on the builds.
This situation has already been submitted as an issue, but marked as Status By Design. Quoting directly from the issue tracker page:
TextMesh mesh is wrong when MeshFilter present on same GameObject.
This is expected behavior.
MeshFilter and TextMesh are both components that rely on a
MeshRenderer component to render the mesh. When they are both present,
they are conflicting over which one gets to set the mesh that the
MeshRenderer should use.
That said, we should not allow a MeshFilter and TextMesh on the same
GameObject because it is not supported anyway. We'll file a separate
bug bug on that.
I think the RectTransform is messing things up. Right click and save the settings of your text mesh. Then use the menus at the top of Unity to add a new, clean 3D text mesh and paste the component settings into that one. Don't choose the UI text if you want to use the 3D text. There is a separate option for the 3D text.
Related
I am working on my first VR project, in which I am displaying satellite data inside of a sphere. The camera/observer is placed in the middle of the sphere and "looks up" at the satellite data, which is rendered in all directions. I am doing this under Unity 2021 using the latest Cardboard SDK and running it on a Pixel-3 on Android 12. After some tinkering, I managed to get the scene to render, but the observer is MUCH too close to the scene. I am aware that the FOV is fixed by the device, but is seems to me that I should be able to scale the scene to "zoom out". However, nothing I have tried works, including the following;
Simply changing the size of the sphere (which is just a single "flip-normalled" object)
Changing the camera parameters (Note: I now understand that these have zero effect in VR, as the device sets the FOV).
Placing the camera object, embedded in an XRRig prefab in my case, inside an arbitrary "GameObject" and re-scaling the object (as specified here)
As in 3, but placing every object inside the GameObject
None of these have any effect on the eventual scene as built on the device. I am at a loss. Surely what I am attempting is possible? I really just want a tiny observer, i.e. to make the "sky" seem much farther away. Any/all help appreciated.
Cheers.
Perhaps you should make the satellites, or the images, smaller when rendering them to the sphere. Just scaling the sphere itself will probably just make everything larger, or smaller, to match the size of the sphere.
In my Google Cardboard project, I have several canvases attached to walls in a room. These canvases have buttons the player can interact with. I set each canvas to World Space, but for some reason, the buttons are rendering in front of objects that should appear in front of the buttons.
update1:
The UI appears behind the cube in the game and scene windows when not running. It's only when I hit play that the image appears in front of the cube. I am adding images to the UI button programatically, but the problem happens even if I add images only using the editor.
update2:
If I disable the cardboard elements in my scene (i.e. use a standard fps camera setup), I do not get the issue.
Picture below: Checkerboard is UI. Gray block is 3D block. I want UI behind the block, on the wall.
Manually move the parent UI object behind the gray object.
Someone on answers.unity3D made this suggestions:
The problem may come from the shader used by the UI element with a
ZTest value set to Off or the Queue tag of the UI element's shader is
"higher" than the tag of the cube's shader
Turns out, and this is apparent in the 3rd screenshot, my UI buttons did not have a material. Once I provided one, I used one that used a standard UI shader (I initially tried unlit, but that made them disappear).
I guess there are still some issues with shaders and google cardboard. Thanks guys
Wondering if there's a simple solution for this; I'm rendering some text with a sprite batch and a bitmap font in a libGDX Android project. Text renders fine, but end up with a few subtle grey spots after some letters, which I want to clear up.
A bit more context; I'm loading in a bold comic sans font (for now), generated using Hiero, I've set the minfilter and magfilter of the font's texture to linear. Also, I'm not scaling the font up or down at any point in my code, but may want to later. Here's a screenshot for reference: http://i824.photobucket.com/albums/zz161/9bjames/Screenshot_zpseac8c515.png (you might need to zoom in a bit).
I've looked it up, and found this: BitmapFont rendering artifacts, but I was wondering if there was a quicker fix... or at least one that's less "hacky". For example, would using a distance field font, or custom shaders help any?
Thanks, let me know if ya need any more info to go on. I'll continue looking into it in the meantime.
-Quick edit: found that using default texture filters (nearest) helps with the grey spots, so long as I'm not scaling up. Seems like the quality also drops in general using TextureFilter.Nearest... but it'll do for now, whilst I get more important parts working. Any recommendations would still be appreciated.
i have been working with object detection / recognition in images captured from an android device camera recently.
the object i am trying to detect are all kinds of buttons that look like this:
Picture of buttons
so far i have been trying with OpenCV and also with the metaio SDK. results:
OpenCV was always detecting something, but gave lots of false hits. also it is too much work to collect all the pictures for what i have in mind. i have tried three ways with OpenCV:
FeatureDetection (SURF, ORB and so on) -> was way too slow and not enough features on my objects.
Template Matching -> seems to only work when the template is exactly a part out of the scene image
Training classifiers -> this worked the best so far, but is too much work for my goal, and still gives too many false detections.
metaioSDK was working ok when i took my reference images (the icon part of each button) out of a picture like shown above, then printed the full image and pointed my android device camera at the printed picture. but when i tried with the real buttons (not a picture of them) then almost nothing got detected anymore. in the metaio documentation it is said that the reference images need to have lots of features and color differences and also should not only consist of white text. well, as you see my reference images are exactly the opposite from what they should be. but thats just how the buttons look ;)
so, my question would be: does any of you have a suggestion about what else i could try to detect and recognize each of those buttons when i point my android camera at them?
As a suggestion can you try the following approach:
Class-Specific Hough Forest for Object Detection
they provide a C code implementation. Compile and run it and see the results, then replace positive and negative training images with the ones you have according the following rules:
In a car you will need to define the following 3 areas:
target region (the image you provided is a good representation of a target region)
nearby working area (this area have information regarding you target relative location) I would recommend: area 3-5 times the target regions, around the target, can be a good working area
everything outside the above can be used as negative images
then,
Use "many" positive images (100-1000) at different viewing angles (-30 - +30 degrees) and various distances.
You will have to make assumptions at which viewing angles and distances your users will use the application. The more strict they are the better performance you will get. A simple "hint" camera overlay can give a good idea to people what you expect the working area to be.
Use few times (3-5) more different negative image set which includes pictures of things that might be in the camera but should not contribute any target position information.
Do not use big images, somewhere around 100-300px in width should be enough
Assemble the database, and modify the configuration file that the code comes with. Run the program, see if performance is OK for your needs.
The program will return a voting map cloud of the object you are looking fore. Add gaussian blur to it, and apply some threshold to it (you will have to make another assumption for this threshold value).
Extracted mask will define the area you are looking for. The size of the masked region can give you good estimate of the object scale. Given this information it will be much easier to select proper template and perform template matching.
(Also some thoughts) You can also try to do a small trick by using goodFeaturesToTrack function with the mask you got, to get a set of locations and compare them with the corresponding locations on a template. Constuct an SSD and solve it for rotation, scale and transition parameters, by mimizing alignment error (but not sure if this approach will work)
I,m using min3d framework on my device to make some car game, so i created some simple car model and simple and its moving, but i want to create ''physics'' and i need the collision detection which isn't provided in min3d (i won't change framework because i have android 2.1 without possibility to upgrade) i want to create it by my self but the problem is that i don,t know how to check if the plane collides with anything what i want to do is:
-create simple flat rectangle (not cube) and i want to place it in front of ''car'' and check if something gets inside of this rectangle and something does i want the car to bounce of it in reversed direction (the problem isn't to bounce but: how to check if something gets through my rectangle)
I have some other problem too:/
When i enclose my ''game''(haha) with a LinearLayout in xml everythong is going fine till i use the command to set the text with the value of rotation of a car for example -then is force close:/ I'm doing it form my class from which i load my objects (i'm providing my classes too)
I was searching for tutorials on the web but none of them was tlaking about 3d collision and even if it was about 3d there was too much code that wasnt need and i was loast in it so i dont get anything
I ask you royal users from stackoverflow to provide me example for creating the rectangle(if needed, because i can laod model from .3ds and .obj)and check if something gets through it(intersects?) not for entire code but just for the method how to do that, and how to refrsh the value of a car, in layout without a crash
By the way: my ''game'' is using qwerty keyboard as input (i,o,p,l keys)
Wanted to post my class here but its to much of lines and was getting erros so grab it on free hosting site, its scanned by avast already on my pc, it contains my entire project with min3d too.
My sources ready to compile and run are(with min3d -which isn't mine):
http://odsiebie.pl/ax1v1p5tam8i/KRL044.7z.html
thanks in advice:)
an approach is to break it down to two dimensions (xy). imagine that your cars are 2D-Rectangles. in the moment you want to check collision, just check if any of the four corners of your "car" is within the rectangle of another car. might be not best practise but works for me.
instead of this you could use r-tree sqlite to check collision.