Questions in topic: "geometry"
http://answers.unity.com/questions/topics/single/1488.html
The latest questions for the topic "geometry"i want to create a triangle from 2 3d vectors
http://answers.unity.com/questions/1628415/i-want-to-create-a-triangle-from-2-3d-vectors.html
Hi i am trying to do a triangle from 2 given 3d vectors and i want the triangle to be symetrical and i dont know how to get the last 3d vector
and with symetrical i mean the sides are equal lengthc#mathgeometrySat, 04 May 2019 12:01:03 GMTeliyahRender Transparent Geometry
http://answers.unity.com/questions/1606440/render-transparent-geometry.html
Hello,
I Have **Render Transparent Geometry() taking 120 ms** in the profiler ! Too much!
----------
**How can I reduce it?**
I heard something about the Filter mode? I have some big background textures with the top part which is all transparent, should I cut it out? I didn't do it in order to maintain a squared compressed file format. Is it a bad choice?texturerenderingrendererprofilergeometryMon, 25 Feb 2019 22:07:56 GMTLeleUnityC#. Inappropriate mesh vertex coordinates returned by another class
http://answers.unity.com/questions/1604656/c-inappropriate-mesh-vertex-coordinates-returned-b.html
Hi all,
<br> <br>
I have made two scripts, one which retrieves geometrical information from an object, such as mesh vertex position, and another script which prints out this information to an XML.
<br> <br>
**Problem**:<br>
When I print out the information and instantiate spheres for debug purpose based on information that I am retrieving directly via button from geometry information script, everything is correct as it should be.
<br> <br>
When I reference the geometry information script from my XML print script, the outputted coordinates of vertices are as if the object was positioned on X=Y=Z=0 with scale of 1
<br> <br>
I suspect this has something to do with what kind of information has been passed into the Geometrical Information script when it's triggered via XML print script.
<br><br>
Script which prints and processes geometrical data retreived from Geometry script. This gives me data as if the relevant game object was on X-Y-Z=0c#verticesgeometryThu, 21 Feb 2019 11:17:06 GMTJollyJumpingBeanPoint on a Plane between two points
http://answers.unity.com/questions/1602880/point-on-a-plane-between-two-points.html
I have a Plane (the class not the gameobject) and two Vector 3 positions.
I am trying to find the point on the line between the two positions that also intersects the plane.
My best idea at the moment is creating a custom plane class that stores the equation of the plane and working it out using algebra however I feel like there is likely a simpler way.
Thanksvector3planegeometrySun, 17 Feb 2019 18:13:00 GMTMomentsStudioImport colliders from Blender
http://answers.unity.com/questions/1602394/import-colliders-from-blender.html
Does Unity have any option to import basic colliders from Blender? I mean, maybe modelling a cube in blender, assigning it any tag or something, so when I import, Unity recognizes those basic objects as colliders.
I know about the mesh collider, but it consumes a lot of resources, so I'm looking for a way to working faster with basic colliders. Thanks!blendercollidersblender-exportinggeometrySat, 16 Feb 2019 13:32:24 GMTNiedon2Domain shader create geometry
http://answers.unity.com/questions/1590034/domain-shader-create-geometry.html
Hi there,
I'd like to create geometry using a domain/hull shader, such that for each triangle of the input mesh I can generate one or several other triangles. I know it's possible using a geometry shader, however these aren't supported on metal.
Could someone give me an example for this? Because it's not so well documented.shadergeometrygeometry shaderMon, 14 Jan 2019 11:34:00 GMTcoen22How to make an object always stick to a mesh?
http://answers.unity.com/questions/1565893/how-to-make-an-object-always-stick-to-a-mesh.html
Hello, i am developing a racing game. But it's not your usual racing game, the bike is supposted to always have the Y coordinate of the same value as the closest point on the map mesh, in other words it is ALWAYS touching it.
What i do not want is the Y coordinate to be dependent upon the X and Y position, as there will be 2 (or maybe more floors).
I have absolutely no idea how to implement this. Completly zero. I am rather new to scripting, and this i way out of my league, i don't even know how to start... The map is not a simple plane, so simple maths won't help. I'll apreaciate any help at all, not necessarily a solution.
Thanks in advancephysicsscripting beginnergeometryThu, 25 Oct 2018 19:43:19 GMTKoteuHow to project a point on to a sphere?
http://answers.unity.com/questions/1545371/how-to-project-a-point-on-to-a-sphere.html
If i have a point (x,y,z) how to project it on to a sphere(x0,y0,z0,radius) (on its surface). My input will be the coordinates of point and sphere. The output should be the coordinates of the projected point on sphere.
I found an answer! :D
public Vector3 ProjectOnSphere(Vector3 OriginalPosition, Vector3 SpherePosition, float radius)
{
Vector3 p = OriginalPosition - SpherePosition;
float pLenght = Mathf.Sqrt(p.x * p.x + p.y * p.y + p.z * p.z);
Vector3 q = (radius / Mathf.Abs(pLenght)) * p;
Vector3 pointOnSphere = q + cameraPosition;
return pointOnSphere;
}programmingmathgeometryprojectionalgebraThu, 23 Aug 2018 08:50:04 GMTartak10tMorphing geometrical shapes
http://answers.unity.com/questions/1533331/morphing-geometrical-shapes.html
Hello everyone,
Maybe someone can help me. I need to make morph from 1 geometrical shape to another. In best case it should be smooth morphing animation. I know that in 3ds max present modificator that allow to make morphing but it works only with objects that have absolutely same topology and polycount/vertexcount.
Will be glad to hear any ideas or suggestions.
Thanks
![alt text][1]
[1]: /storage/temp/121459-q.jpganimationtransformgeometrymorphmorphingTue, 24 Jul 2018 08:17:02 GMTtonnynevelConfused about local, world coordinates when it comes to child objects...
http://answers.unity.com/questions/1523734/confused-about-local-world-coordinates-when-it-com.html
OK. I got a cube. And the cube has a child cube. **Cubey**.
I also have a **point** on the surface of Cubey--and I need to know which *face* of Cubey that point is on.
That's not the problem--I figured out that if I compared the angles between the directional vectors from each of Cubey's faces to the point's vector then any angle less than 45 degrees means my surface point is on that side. For example:
If: **Mathf.Abs(Vector3.Angle(surface_point,cubey.transform.right)** is less than 45 degrees, my surface point is on the *right* side. If it's > 45 degrees, it's round the next corner. (Let's not get into edge cases).
This works fine. *As long as Cubey shares the same position as his parent cube.* Once Cubey moves away, things get inconsistent.
So--something to do with world vs local space I'm sure. But no matter what I do I can't figure out how to correct it. I've converted surface point to local but it doesn't fix it.
I guess the problem is I'm having a hard time getting my head around just where the vectors here are actually going. For instance--if I convert my **surface point** coordinates to Local space (in other words, relative to the the Parent) does that mean I'm ending up with a vector from the parent's 0,0,0 point through the point on Cubey? That doesn't sound like what I need. It seems like I'd want a line from Cubey's 0,0,0 point to the point on his surface, and then I'd want to get the angle between that vector and the one also starting from Cubey's 0,0,0 but aiming along his right-transform. How do I do that for a child object? Seems all the vectors stem either world origin or parent origin.
I've read a lot on it, but I feel like I still have some fundamental misunderstanding when it comes to child object geometry--I'm really hoping someone can shed some light...?coordinateschild objectgeometryparent and childFri, 29 Jun 2018 22:40:09 GMTDana_BC# Recreating Blender's Skin Modifier in Unity
http://answers.unity.com/questions/1515303/c-recreating-blenders-skin-modifier-in-unity.html
Hi, I'm not sure how to approach creating a script that wraps around a group of points in unity, the end result would be something like blender's skin Modifier:
![alt text][1]
[1]: /storage/temp/118391-modeling-modifiers-generate-skin-example.png
,Hi, I'm not sure how to approach creating a script that wraps around a group of points in unity, the end result would be something like blender's skin Modifier:
[1]: https://docs.blender.org/manual/en/dev/_images/modeling_modifiers_generate_skin_example.pngmeshscript.spawngenerationgeometryThu, 07 Jun 2018 01:23:07 GMTgeorgetheonemakerHow to get the cross direction for 3 points?
http://answers.unity.com/questions/1503945/how-to-get-the-cross-direction-for-3-points.html
![alt text][1]
[1]: /storage/temp/116516-434a10f76b6e8fb452fe4ab983cc104f.png
How would I get the normal/cross from the three points marked in red? Assuming the points go in order 1, 2, 3 - Left to right.scripting problemgeometryWed, 09 May 2018 09:47:05 GMTHHammeriteHow to calculate the point at which two lines meet?
http://answers.unity.com/questions/1503613/how-to-calculate-the-point-at-which-two-lines-meet.html
![alt text][1]
[1]: /storage/temp/116476-bf1d5aa2ae63b28a02b0a0a511b0ec8c.png
So I'm making a procedural mesh which should always have the same width no matter the angle or direction of the corners in it. In order to ensure the width is consistent the middle (lowest) point has to reposition itself relative to the angle of the shape. Does anyone have any suggestions as to how this should be calculated, assuming all corners in this illustration have a point in space.
I'm sure the solution is simple, any help would be greatly appreciated :)geometryTue, 08 May 2018 14:43:18 GMTHHammeriteCan I transform all of my objects by referencing 2 points?
http://answers.unity.com/questions/1498255/can-i-transform-all-of-my-objects-by-referencing-2.html
My little VR application is nearly over. For geocoding, I want to transform the objects from local to geocoordinates by using 2 points (similarity transformation). Is it possible? If it's possible, how?unity 5coordinatesgeometrycoordinate-systemcoordinateTue, 24 Apr 2018 21:17:13 GMTtungakinCross with cubes using for?
http://answers.unity.com/questions/1494001/cross-with-cubes-using-for.html
How do I make a **for** roll these coordinates?
![alt text][1]
[1]: /storage/temp/115047-area.pngc#for-loopgeometrySun, 15 Apr 2018 00:50:54 GMTFokinhaasGetting position of a coordinate on the surface of a sphere
http://answers.unity.com/questions/1493550/getting-position-of-a-coordinate-on-the-surface-of.html
So I want to create a object B close to another object A, but I'm trying to avoid that A covers B:
![hides][1]
I have thinking how to achieve that. Take a look of the following drawing:
![not hide][2]
I have been thinking in a solution in a math - geometry way before searching for some Unity3D function to solve the problem. I have realise A and B would be on the same surface if the camera is within a sphere with radius c-A. So I guess the solution can be related to get a point at a B at a distance A-B from A on the surface of the sphere with radius c-A. Does it has sense? Any other idea? How to do it with maths and Unity?
[1]: /storage/temp/114934-asset-2.png
[2]: /storage/temp/114935-asset-1.pngpositioncoordinatesgeometryFri, 13 Apr 2018 21:10:16 GMTchelderMesh renderer turns off on runtime?
http://answers.unity.com/questions/1490302/mesh-renderer-turns-off-on-runtime.html
Hi,
I've created an app for the HoloLens using Vuforia. In this app, I've got multiple arrows as children of instructions within the ImageTarget.![alt text][1]
On runtime however the mesh renderer turns off making the objects invisible.![alt text][2]
If I move the objects from under the parent files they are working.
I just can't seem to find the problem, so if anybody has a bright idea :)
Thank you in advance,
~Danny
[1]: /storage/temp/114364-question-1-2.png
[2]: /storage/temp/114365-question-2-2.pnginspectorwindowsvuforiasettingsgeometryFri, 06 Apr 2018 12:08:19 GMTDanny-d-vTechniques for performance and issue with polar calculations
http://answers.unity.com/questions/1484916/improving-performance-using-many-gameobjects-and-f.html
I am trying to figure out the fundamentals of Unity by making what I thought was a simple project. The idea is that you have a square grid of cubes, and parts of the grid would burst up in sync with music to create an interesting audio visualizer. I am trying to get it working at random points and will do the music part later. Right now, it works perfectly on some settings, but when the circle "radius" gets too big, it doesn't appear to work correctly. The effect that i'm going for is similar to this video (but with a fixed focal point, it should not oscillate but rather go through one cycle): [Example video][1]
I also want to make sure since i'm learning Unity that I am being efficient in how I do things. Right now I have a rough idea of C# syntax, so for simplicity I iterate over two (2D?) arrays. There are probably better techniques to do what I am doing, so if you can provide optimizations for a beginner that would be very helpful. I am not sure why the radial ripple effect doesn't work on large values (try 15 gridsize, 3 cubesize, 1.5 growth interval, 25 growth size, and 5 shrink rate to see what I mean). Here is my entire code, which is attached to a standalone object:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CubeGenerator : MonoBehaviour {
public GameObject whiteCube;
public GameObject blackCube;
public int gridSize;
public int cubeSize;
public float growthInterval;
public float growthSize;
public float shrinkRate;
private GameObject[,] cubes;
private bool[,] grownCubes;
private int shrinkScale;
void Start () {
shrinkScale = 3;
//Scale the cubes based on the grid and cube size
whiteCube.transform.localScale = new Vector3(cubeSize, cubeSize, cubeSize);
blackCube.transform.localScale = new Vector3(cubeSize, cubeSize, cubeSize);
cubes = new GameObject[gridSize, gridSize];
grownCubes = new bool[gridSize, gridSize];
for (int x = 0; x < gridSize; x++) {
for (int z = 0; z < gridSize; z++) {
if (x % 2 == z % 2) {
cubes[x, z] = (GameObject)Instantiate(whiteCube, new Vector3 (x * cubeSize, (float)cubeSize / 2, z * cubeSize), Quaternion.identity);
} else {
cubes[x, z] = (GameObject)Instantiate(blackCube, new Vector3 (x * cubeSize, (float)cubeSize / 2, z * cubeSize), Quaternion.identity);
}
grownCubes[x, z] = false;
}
}
}
//Randomly grow a cube at this interval (seconds)
float nextTime = 0;
void Update () {
if (Time.time >= nextTime)
{
int magnitude = (int)growthSize / cubeSize;
Vector3 initialPosition = transform.position;
Vector3 growth = new Vector3(0, growthSize, 0);
int randomX = Random.Range(0, gridSize);
int randomZ = Random.Range(0, gridSize);
//ScaleObject(cubes[randomX, randomZ], growth, 1);
for (int radius = 0; radius < magnitude; radius++)
{
if (radius > 0)
{
int angleDelta = (int)(360 / (4 * radius));
for (int degrees = 0; degrees < 360; degrees += angleDelta)
{
int x = (int)(radius * Mathf.Cos(degToRad(degrees))) + randomX;
int z = (int)(radius * Mathf.Sin(degToRad(degrees))) + randomZ;
if (x >= 0 && x < gridSize && z >= 0 && z < gridSize && grownCubes[x, z] == false)
{
grownCubes[x, z] = true;
ScaleObject(cubes[x, z], growth * Mathf.Pow((float)2 / 3, (float)(radius)), 1);
}
}
}
else
{
ScaleObject(cubes[randomX, randomZ], growth, 1);
}
}
nextTime += growthInterval;
}
//Always shrink cubes if they are over the initial size
foreach (GameObject cube in cubes)
{
if (cube.transform.localScale.y > cubeSize)
{
Vector3 shrink = new Vector3(0, Mathf.Min(shrinkRate, cube.transform.localScale.y - cubeSize) * Time.deltaTime * shrinkScale, 0);
ScaleObject(cube, shrink, -1);
}
}
for (int x = 0; x < gridSize; x++) {
for (int z = 0; z < gridSize; z++) {
grownCubes[x, z] = false;
}
}
}
void ScaleObject (GameObject obj, Vector3 scalar, int direction)
{
obj.transform.localScale += direction * scalar;
obj.transform.position += (direction * scalar) / 2.0f;
}
float degToRad (float degree)
{
return (float)degree * Mathf.PI / 180;
}
}
Thank you for bearing with me.
[1]: https://videoblocks-content.s3.amazonaws.com/video/preview/jFnaQEy/videoblocks-black-boxes-with-shining-edges-create-smooth-ripples-loop-ready-animation-of-dark-cubes_bfjqzigug__PM.mp4optimizationgeometrysyntaxcubesradialSat, 24 Mar 2018 23:13:38 GMTadapapGet / Calculate edges of a 3D object - C #
http://answers.unity.com/questions/1479563/get-calculate-edges-of-a-3d-object-c.html
I need to get all vertices in the edge position of a determinate object 3D (in this case a path).
See the image:
![alt text][1]
My question is, how can I get only the edges vertices, like the image?
[1]: /storage/temp/112881-questao-vertices-en.pngc#mathgeometryMon, 12 Mar 2018 22:54:31 GMTgabrieltvaLarge # of gameobjects run smoothly or alternative?
http://answers.unity.com/questions/1479203/large-of-gameobjects-run-smoothly-or-alternative.html
I have been working on a building game project in unity, a Lego sort, and one problem that I have recently come across is size. Small numbers of these bricks go together with little lag, but then the frames drop as the brick count increases:
![alt text][1]
[1]: /storage/temp/112824-problembricks.png
This image has about 1k bricks on the beautiful settings.
The bricks themselves have triggers on them that act as stud connections, and each brick has some script that handles connections and other such, all parented to an empty with a rigidbody (Set to isKinematic for now, so physics aren't playing a role in my frames). I would really like to know if there's a way to optimize this to allow for large scaling in the 10's of thousands of bricks, some trick about Unity's rendering/processing settings I don't know about, or maybe some mesh connection?
Any help would be appreciated, even if it the answer is find another engineoptimizationgameobjectsgeometrytrisMon, 12 Mar 2018 04:50:16 GMTSeaLeviathanCalculating mesh area
http://answers.unity.com/questions/1474675/calculating-mesh-area.html
I have a game with the shape slicing mechanics.
I need to get the area (it's in 2D) of the each slice. Each slice has Mesh, PolygonCollider2D and RigidBody2D.
How can I get a slice area using existing components?
The area must represent actual object size on screen and should know about object scale.
Rect and bound solutions don't have a good accuracy with complex shapes like stars. So I'd already tried them.meshgeometrycalculationsWed, 28 Feb 2018 15:45:10 GMTinterpol_kunfind point projection on circle around another point
http://answers.unity.com/questions/1463661/find-point-projection-on-circle-around-another-poi.html
Hello
![alt text][1]
-red is player position
-blue are objectives position
-orange are the points i need to find, always positioned on the black circle around the player, even if the objective point is inside of it.
How can i do it?
Thaaanks <3
[1]: /storage/temp/110615-immagine.jpggeometrySat, 03 Feb 2018 11:12:57 GMTcattagamesHow to see geometry
http://answers.unity.com/questions/1451594/how-to-see-geometry.html
So. ![alt text][1]
[1]: /storage/temp/108758-anyway.png
I am making a game with no textures (I just make and paint objects with basic colors in Sketchup then export them straight into Unity), but I am facing this one problem, that is, geometry cant be seen in dark, is there any way to deal with it other than use textures?geometrynot showingSun, 07 Jan 2018 15:42:58 GMTBlAcK_BlAcKiToMesh Vertices Welding
http://answers.unity.com/questions/1441219/mesh-vertices-welding.html
Hello!
I'm on Unity 2017.2.0p4 and I am writing a script that combine meshes, something very similar to this:
https://docs.unity3d.com/ScriptReference/Mesh.CombineMeshes.html
I am also trying to merge/weld vertices which distance is within a certain range, but without success... I tried every script on the web, no success... I also exported the combined mesh in .obj format and tried to re-import it in unity with drag and drop, and even if the "Weld Vertices" toggle in the "Import Settings" is on true, it does not work.
Need some help please, Thank you!meshverticesmeshfiltergeometryMon, 11 Dec 2017 08:26:22 GMTPhobetorWeird navmesh artifact
http://answers.unity.com/questions/1431637/weird-navmesh-artifact.html
I have a scene with stairs going up. The inside is fine, more or less even if it does intersect the stairs in an odd way:
![alt text][1]
The geometry at the top of the stairs isn't too fancy:
![alt text][2]
But the navmesh generated on the top has an odd missing piece:
![alt text][3]
Anybody know how to clean this up?
[1]: /storage/temp/105408-reference22.png
[2]: /storage/temp/105409-reference.png
[3]: https://i.stack.imgur.com/8zUPN.pngresolutionnavmeshnavigationgeometrySun, 12 Nov 2017 04:29:53 GMTaaronfjerstadWith a second material on an object, how do I restrict it to only 1 part of the object?
http://answers.unity.com/questions/1431560/with-a-second-material-on-an-object-how-do-i-restr.html
I have 2 materials applied to the object, and the 2nd one, I only want it on top of the cube. How do I do this?materialmaterialsgeometrySat, 11 Nov 2017 20:07:23 GMTwatercolorheartdevGet the raod turn radius
http://answers.unity.com/questions/1424047/get-the-raod-turn-radius.html
So I have two Vector3s A and B they represent the beginning and the end of a road turn (for a racing game). They also look at the direction of the road. Now what I want is given these two vectors to find the radius of the circle that is created.![alt text][1]
[1]: /storage/temp/104211-img-20171022-143920.jpg
Here is a visual representation of what I want to find.
Note that in the shape I have vector2s because I dont care about the vector3.y so I have replaced the vector2.y with the vector3.z.vector3geometryracingturnSun, 22 Oct 2017 11:48:39 GMTcgeopapaChange Global cartesian system vectors
http://answers.unity.com/questions/1421853/change-global-cartesian-system-vectors.html
Hello everyone,
I'm working on a visualization tool in which I use Unity to show some result from an external physics engine. The problem is that this physics engine is not using the same cartesian system as Unity, meaning that I have to convert every data incoming from the external physics engine. I would like to know if instead of convert all incoming data, I could change the Global cartesian system directly in the setting of Unity, for exemple if I could change the direction of "x" vector so that the frame respect the right-hand rule ?vectormatrixgeometryTue, 17 Oct 2017 15:01:16 GMTNazahaamGiven two vectors on a sphere, rotate an object between them.
http://answers.unity.com/questions/1400927/given-two-vectors-on-a-sphere-rotate-an-object-bet.html
Hello, I am trying to figure out how to rotate an object between two points on a sphere, given you already know the start and end Vectors as well as the spheres radius. The end goal is to have a particle trail move along this path that the rotating game object creates. I am not quite sure where to start, so any help is greatly appreciated! I have attached a reference image of the path I am trying to achieve.
![Reference Image][1]
[1]: /storage/temp/100996-arc.jpgrotationgeometrytrigonometryThu, 31 Aug 2017 01:35:01 GMTrichards19kVertice count is higher than it should be whats happening?
http://answers.unity.com/questions/1366767/vertice-count-is-higher-than-it-should-be-whats-ha.html
i recently finished making a map on blender 3 and it stands at 200k vertices's on blender so i imported the map in a fbx file to unity and placed it in the scene for some reason when i point my camera in a section of the map it will show form 500k to 1 million vertices's when my map is 200k vertices's i really dont know whats going on i dont have any tessellation on can someone pls help here are some pics
[1]: /storage/temp/96094-screenshot-398.pnggeometrySat, 17 Jun 2017 13:54:50 GMTScorpion_fps