Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mustafa Enes Temel
Unity2-0GrabCut
Commits
78b3ce41
Commit
78b3ce41
authored
Jul 13, 2021
by
Mustafa Temel
Browse files
new update
parent
2ca05da9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Assets/Scripts/NTScript.cs
View file @
78b3ce41
...
...
@@ -49,9 +49,6 @@ public class NTScript : MonoBehaviour
int
y
=
middle
%
1000
;
print
(
x
);
print
(
y
);
int
radius
=
350
;
float
rSquared
=
radius
*
radius
;
...
...
@@ -60,13 +57,34 @@ public class NTScript : MonoBehaviour
Material
materialShader
;
tempColor
.
a
=
0f
;
for
(
int
u
=
x
-
radius
;
u
<
x
+
radius
+
1
;
u
++)
for
(
int
v
=
y
-
radius
;
v
<
y
+
radius
+
1
;
v
++)
if
(((
x
-
u
)
*
(
x
-
u
)
+
(
y
-
v
)
*
(
y
-
v
))
*
5.5
>
rSquared
)
tex
.
SetPixel
(
u
,
v
,
Color
.
white
);
tex
.
SetPixel
(
u
,
v
,
tempColor
);
/* Material unlit;
unlit = new Material(Shader.Find("Unlit/camshader"));
this.GetComponent<Renderer>().material = unlit;
for (x=0; x < tex.height; x++)
{
for(y =0; y<tex.width; y++)
{
if(tex.GetPixel(x,y) == Color.white)
{
tex.SetPixel(x, y, unlit.color);
}
}
}
//this.GetComponent<Renderer>().material = unlit;*/
tex
.
Apply
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment