Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to transform coordinates #47

@Gesporidgers

Description

@Gesporidgers

I need to transform coords of substracted object.

Image See the coords? Substraction works fine Image coords are now 0,0,0 but it is not... Is substract using this code
var subtracted = other.gameObject;
var sourceComponent = gameObject;
var transf = sourceComponent.transform,position;
Model result = CSG.Subtract(sourceComponent, subtracted);
sourceComponent.transform.position = new Vector3(0, 0, 0);
sourceComponent.GetComponent<MeshFilter>().sharedMesh = result.mesh;
sourceComponent.GetComponent<MeshRenderer>().sharedMaterials = result.materials.ToArray();
sourceComponent.transform.position = transf.position;

How to apply previous coords?
If I apply transf mesh teleports outside scene

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions