How to project 3d image in the planes xy, xz, yz?Sketch-type graphics with transparency and dashed hidden lines?2D projection of a 3D surfaceImage processing, maskingForce change in aspect ratio of Inset imageColor Transfer from colored image into grayscale imageColoring image components according to their areaCircular crop: extract non rectangular parts of an imageEstimate the “Blurry” distribution of an imageHow to extract a single image from the output of the DiscreteWaveletTransform[]?How can I crop a 3D object in the format .obj or .noff?
Replacing triangulated categories with something better
What is the difference between tone deafness and amusia?
What's the earliest a champion can have a focus pool of 3?
How does the Gameboy Link Cable work?
Hypothesis testing- with normal approximation
How do Precipitation Reactions behave in the Absence of Gravity?
summarize for all other values per group in dplyr
Is a new blessing required when taking off and putting back on your tallit?
Why is the Falcon Heavy center core recovery done at sea?
Iterator for traversing a tree [v2]
Reviewer wants me to do massive amount of work, the result would be a different article. Should I tell that to the editor?
What could a technologically advanced but outnumbered alien race do to destroy humanity?
Why did the people of Zion never find evidence of the previous cycles?
How can I determine if two vertices on a polygon are consecutive?
Leaving passport in the hotel room
Computationally expensive AI techniques (that are promising!)
What is an "07" chord?
Why are so many cities in the list of 50 most violent cities in the world located in South and Central America?
Spent or spend?
What is a GPU year?
What is a word for the feeling of constantly wanting new possessions?
How to deal with non-stop callers in the service desk
ignoring potentiometer value variations
windows 10 computer waking up from sleep
How to project 3d image in the planes xy, xz, yz?
Sketch-type graphics with transparency and dashed hidden lines?2D projection of a 3D surfaceImage processing, maskingForce change in aspect ratio of Inset imageColor Transfer from colored image into grayscale imageColoring image components according to their areaCircular crop: extract non rectangular parts of an imageEstimate the “Blurry” distribution of an imageHow to extract a single image from the output of the DiscreteWaveletTransform[]?How can I crop a 3D object in the format .obj or .noff?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
.everyonelovesstackoverflowposition:absolute;height:1px;width:1px;opacity:0;top:0;left:0;pointer-events:none;
$begingroup$
Some idea of how to do something similar to the image, but with any 3d object
graphics graphics3d image-processing image image3d
$endgroup$
add a comment
|
$begingroup$
Some idea of how to do something similar to the image, but with any 3d object
graphics graphics3d image-processing image image3d
$endgroup$
$begingroup$
Possible duplicate: mathematica.stackexchange.com/questions/164663/…. This also seems relevant to the image above, depending on what the dashed lines represent: mathematica.stackexchange.com/questions/45410/…
$endgroup$
– Michael E2
Jun 4 at 0:37
add a comment
|
$begingroup$
Some idea of how to do something similar to the image, but with any 3d object
graphics graphics3d image-processing image image3d
$endgroup$
Some idea of how to do something similar to the image, but with any 3d object
graphics graphics3d image-processing image image3d
graphics graphics3d image-processing image image3d
edited Jun 3 at 6:26
user64494
4,2712 gold badges14 silver badges23 bronze badges
4,2712 gold badges14 silver badges23 bronze badges
asked Jun 2 at 22:24
zeroszeros
8421 gold badge7 silver badges13 bronze badges
8421 gold badge7 silver badges13 bronze badges
$begingroup$
Possible duplicate: mathematica.stackexchange.com/questions/164663/…. This also seems relevant to the image above, depending on what the dashed lines represent: mathematica.stackexchange.com/questions/45410/…
$endgroup$
– Michael E2
Jun 4 at 0:37
add a comment
|
$begingroup$
Possible duplicate: mathematica.stackexchange.com/questions/164663/…. This also seems relevant to the image above, depending on what the dashed lines represent: mathematica.stackexchange.com/questions/45410/…
$endgroup$
– Michael E2
Jun 4 at 0:37
$begingroup$
Possible duplicate: mathematica.stackexchange.com/questions/164663/…. This also seems relevant to the image above, depending on what the dashed lines represent: mathematica.stackexchange.com/questions/45410/…
$endgroup$
– Michael E2
Jun 4 at 0:37
$begingroup$
Possible duplicate: mathematica.stackexchange.com/questions/164663/…. This also seems relevant to the image above, depending on what the dashed lines represent: mathematica.stackexchange.com/questions/45410/…
$endgroup$
– Michael E2
Jun 4 at 0:37
add a comment
|
2 Answers
2
active
oldest
votes
$begingroup$
You can post-process a Graphics3D
object to project the lines to the left, back and bottom planes using a function like:
ClearAll[projectToWalls]
projectToWalls = Module[pr = PlotRange[#],
Normal[#] /. Line[x_, ___] :>
Line[x], Line[x /. a_, b_, c_ :> pr[[1, 1]], b, c],
Line[x /. a_, b_, c_ :> a, pr[[2, 2]], c],
Line[x /. a_, b_, c_ :> a, b, pr[[3, 1]]]] &;
Examples:
pp1 = ParametricPlot3D[4 + (3 + Cos[v]) Sin[u],
4 + (3 + Cos[v]) Cos[u], 4 + Sin[v], 8 + (3 + Cos[v]) Cos[u],
3 + Sin[v], 4 + (3 + Cos[v]) Sin[u], u, 0, 2 Pi, v, 0, 2 Pi,
PlotStyle -> Red, Green];
projectToWalls @ pp1
projectToWalls @
Graphics3D[White, MeshPrimitives[Tetrahedron[], 1],
MeshPrimitives[Cuboid[0, 1/2, 0], 1],
PlotRange -> -1, 2, -1, 2, -1, 2, Background -> Black]
Update: Taking Roman's idea a step further using Texture
d polygons:
SeedRandom[1234];
P = Graphics3D[Hue@RandomReal[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]];
pr = PlotRange[P];
rect = #, #2[[1]], #[[-1]], #2, #[[1]], #2[[-1]] & @@ Transpose[pr[[##]]] &;
texturedPoly = Texture[Rasterize[#, Background -> None]],
Polygon[#2, VertexTextureCoordinates -> 0, 0, 1, 0, 1, 1, 0, 1] &;
left, back, bottom = Show[P, ViewPoint -> #, Boxed -> False, Axes -> False,
Lighting -> "Neutral"] & /@ Right, Front, Top;
leftWall = Prepend[#, pr[[1, 1]] - 1] & /@ rect[2, 3];
backWall = Insert[#, pr[[2, 1]] + 2, 2] & /@ rect[1, 3];
bottomWall = Append[#, pr[[3, 1]] - 1] & /@ rect[1, 2];
Graphics3D[Opacity[.2], P[[1]], EdgeForm[None], Opacity[1],
MapThread[texturedPoly, left, back, bottom, leftWall, backWall, bottomWall],
BoxRatios -> 1, PlotRange -> -1, 1.5, -.5, 2.1, -1, 1.5]
$endgroup$
add a comment
|
$begingroup$
If you only need the 2D projection images, you can just project the 3D image from the six cardinal directions:
SeedRandom[1234];
P = Graphics3D[RandomColor[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]]
Show[P, ViewPoint -> #] & /@ ∞,0,0, -∞,0,0, 0,∞,0, 0,-∞,0, 0,0,∞, 0,0,-∞
Working with the ViewVertical
option might also help.
$endgroup$
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199612%2fhow-to-project-3d-image-in-the-planes-xy-xz-yz%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can post-process a Graphics3D
object to project the lines to the left, back and bottom planes using a function like:
ClearAll[projectToWalls]
projectToWalls = Module[pr = PlotRange[#],
Normal[#] /. Line[x_, ___] :>
Line[x], Line[x /. a_, b_, c_ :> pr[[1, 1]], b, c],
Line[x /. a_, b_, c_ :> a, pr[[2, 2]], c],
Line[x /. a_, b_, c_ :> a, b, pr[[3, 1]]]] &;
Examples:
pp1 = ParametricPlot3D[4 + (3 + Cos[v]) Sin[u],
4 + (3 + Cos[v]) Cos[u], 4 + Sin[v], 8 + (3 + Cos[v]) Cos[u],
3 + Sin[v], 4 + (3 + Cos[v]) Sin[u], u, 0, 2 Pi, v, 0, 2 Pi,
PlotStyle -> Red, Green];
projectToWalls @ pp1
projectToWalls @
Graphics3D[White, MeshPrimitives[Tetrahedron[], 1],
MeshPrimitives[Cuboid[0, 1/2, 0], 1],
PlotRange -> -1, 2, -1, 2, -1, 2, Background -> Black]
Update: Taking Roman's idea a step further using Texture
d polygons:
SeedRandom[1234];
P = Graphics3D[Hue@RandomReal[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]];
pr = PlotRange[P];
rect = #, #2[[1]], #[[-1]], #2, #[[1]], #2[[-1]] & @@ Transpose[pr[[##]]] &;
texturedPoly = Texture[Rasterize[#, Background -> None]],
Polygon[#2, VertexTextureCoordinates -> 0, 0, 1, 0, 1, 1, 0, 1] &;
left, back, bottom = Show[P, ViewPoint -> #, Boxed -> False, Axes -> False,
Lighting -> "Neutral"] & /@ Right, Front, Top;
leftWall = Prepend[#, pr[[1, 1]] - 1] & /@ rect[2, 3];
backWall = Insert[#, pr[[2, 1]] + 2, 2] & /@ rect[1, 3];
bottomWall = Append[#, pr[[3, 1]] - 1] & /@ rect[1, 2];
Graphics3D[Opacity[.2], P[[1]], EdgeForm[None], Opacity[1],
MapThread[texturedPoly, left, back, bottom, leftWall, backWall, bottomWall],
BoxRatios -> 1, PlotRange -> -1, 1.5, -.5, 2.1, -1, 1.5]
$endgroup$
add a comment
|
$begingroup$
You can post-process a Graphics3D
object to project the lines to the left, back and bottom planes using a function like:
ClearAll[projectToWalls]
projectToWalls = Module[pr = PlotRange[#],
Normal[#] /. Line[x_, ___] :>
Line[x], Line[x /. a_, b_, c_ :> pr[[1, 1]], b, c],
Line[x /. a_, b_, c_ :> a, pr[[2, 2]], c],
Line[x /. a_, b_, c_ :> a, b, pr[[3, 1]]]] &;
Examples:
pp1 = ParametricPlot3D[4 + (3 + Cos[v]) Sin[u],
4 + (3 + Cos[v]) Cos[u], 4 + Sin[v], 8 + (3 + Cos[v]) Cos[u],
3 + Sin[v], 4 + (3 + Cos[v]) Sin[u], u, 0, 2 Pi, v, 0, 2 Pi,
PlotStyle -> Red, Green];
projectToWalls @ pp1
projectToWalls @
Graphics3D[White, MeshPrimitives[Tetrahedron[], 1],
MeshPrimitives[Cuboid[0, 1/2, 0], 1],
PlotRange -> -1, 2, -1, 2, -1, 2, Background -> Black]
Update: Taking Roman's idea a step further using Texture
d polygons:
SeedRandom[1234];
P = Graphics3D[Hue@RandomReal[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]];
pr = PlotRange[P];
rect = #, #2[[1]], #[[-1]], #2, #[[1]], #2[[-1]] & @@ Transpose[pr[[##]]] &;
texturedPoly = Texture[Rasterize[#, Background -> None]],
Polygon[#2, VertexTextureCoordinates -> 0, 0, 1, 0, 1, 1, 0, 1] &;
left, back, bottom = Show[P, ViewPoint -> #, Boxed -> False, Axes -> False,
Lighting -> "Neutral"] & /@ Right, Front, Top;
leftWall = Prepend[#, pr[[1, 1]] - 1] & /@ rect[2, 3];
backWall = Insert[#, pr[[2, 1]] + 2, 2] & /@ rect[1, 3];
bottomWall = Append[#, pr[[3, 1]] - 1] & /@ rect[1, 2];
Graphics3D[Opacity[.2], P[[1]], EdgeForm[None], Opacity[1],
MapThread[texturedPoly, left, back, bottom, leftWall, backWall, bottomWall],
BoxRatios -> 1, PlotRange -> -1, 1.5, -.5, 2.1, -1, 1.5]
$endgroup$
add a comment
|
$begingroup$
You can post-process a Graphics3D
object to project the lines to the left, back and bottom planes using a function like:
ClearAll[projectToWalls]
projectToWalls = Module[pr = PlotRange[#],
Normal[#] /. Line[x_, ___] :>
Line[x], Line[x /. a_, b_, c_ :> pr[[1, 1]], b, c],
Line[x /. a_, b_, c_ :> a, pr[[2, 2]], c],
Line[x /. a_, b_, c_ :> a, b, pr[[3, 1]]]] &;
Examples:
pp1 = ParametricPlot3D[4 + (3 + Cos[v]) Sin[u],
4 + (3 + Cos[v]) Cos[u], 4 + Sin[v], 8 + (3 + Cos[v]) Cos[u],
3 + Sin[v], 4 + (3 + Cos[v]) Sin[u], u, 0, 2 Pi, v, 0, 2 Pi,
PlotStyle -> Red, Green];
projectToWalls @ pp1
projectToWalls @
Graphics3D[White, MeshPrimitives[Tetrahedron[], 1],
MeshPrimitives[Cuboid[0, 1/2, 0], 1],
PlotRange -> -1, 2, -1, 2, -1, 2, Background -> Black]
Update: Taking Roman's idea a step further using Texture
d polygons:
SeedRandom[1234];
P = Graphics3D[Hue@RandomReal[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]];
pr = PlotRange[P];
rect = #, #2[[1]], #[[-1]], #2, #[[1]], #2[[-1]] & @@ Transpose[pr[[##]]] &;
texturedPoly = Texture[Rasterize[#, Background -> None]],
Polygon[#2, VertexTextureCoordinates -> 0, 0, 1, 0, 1, 1, 0, 1] &;
left, back, bottom = Show[P, ViewPoint -> #, Boxed -> False, Axes -> False,
Lighting -> "Neutral"] & /@ Right, Front, Top;
leftWall = Prepend[#, pr[[1, 1]] - 1] & /@ rect[2, 3];
backWall = Insert[#, pr[[2, 1]] + 2, 2] & /@ rect[1, 3];
bottomWall = Append[#, pr[[3, 1]] - 1] & /@ rect[1, 2];
Graphics3D[Opacity[.2], P[[1]], EdgeForm[None], Opacity[1],
MapThread[texturedPoly, left, back, bottom, leftWall, backWall, bottomWall],
BoxRatios -> 1, PlotRange -> -1, 1.5, -.5, 2.1, -1, 1.5]
$endgroup$
You can post-process a Graphics3D
object to project the lines to the left, back and bottom planes using a function like:
ClearAll[projectToWalls]
projectToWalls = Module[pr = PlotRange[#],
Normal[#] /. Line[x_, ___] :>
Line[x], Line[x /. a_, b_, c_ :> pr[[1, 1]], b, c],
Line[x /. a_, b_, c_ :> a, pr[[2, 2]], c],
Line[x /. a_, b_, c_ :> a, b, pr[[3, 1]]]] &;
Examples:
pp1 = ParametricPlot3D[4 + (3 + Cos[v]) Sin[u],
4 + (3 + Cos[v]) Cos[u], 4 + Sin[v], 8 + (3 + Cos[v]) Cos[u],
3 + Sin[v], 4 + (3 + Cos[v]) Sin[u], u, 0, 2 Pi, v, 0, 2 Pi,
PlotStyle -> Red, Green];
projectToWalls @ pp1
projectToWalls @
Graphics3D[White, MeshPrimitives[Tetrahedron[], 1],
MeshPrimitives[Cuboid[0, 1/2, 0], 1],
PlotRange -> -1, 2, -1, 2, -1, 2, Background -> Black]
Update: Taking Roman's idea a step further using Texture
d polygons:
SeedRandom[1234];
P = Graphics3D[Hue@RandomReal[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]];
pr = PlotRange[P];
rect = #, #2[[1]], #[[-1]], #2, #[[1]], #2[[-1]] & @@ Transpose[pr[[##]]] &;
texturedPoly = Texture[Rasterize[#, Background -> None]],
Polygon[#2, VertexTextureCoordinates -> 0, 0, 1, 0, 1, 1, 0, 1] &;
left, back, bottom = Show[P, ViewPoint -> #, Boxed -> False, Axes -> False,
Lighting -> "Neutral"] & /@ Right, Front, Top;
leftWall = Prepend[#, pr[[1, 1]] - 1] & /@ rect[2, 3];
backWall = Insert[#, pr[[2, 1]] + 2, 2] & /@ rect[1, 3];
bottomWall = Append[#, pr[[3, 1]] - 1] & /@ rect[1, 2];
Graphics3D[Opacity[.2], P[[1]], EdgeForm[None], Opacity[1],
MapThread[texturedPoly, left, back, bottom, leftWall, backWall, bottomWall],
BoxRatios -> 1, PlotRange -> -1, 1.5, -.5, 2.1, -1, 1.5]
edited Jun 3 at 8:31
answered Jun 2 at 23:50
kglrkglr
222k10 gold badges253 silver badges511 bronze badges
222k10 gold badges253 silver badges511 bronze badges
add a comment
|
add a comment
|
$begingroup$
If you only need the 2D projection images, you can just project the 3D image from the six cardinal directions:
SeedRandom[1234];
P = Graphics3D[RandomColor[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]]
Show[P, ViewPoint -> #] & /@ ∞,0,0, -∞,0,0, 0,∞,0, 0,-∞,0, 0,0,∞, 0,0,-∞
Working with the ViewVertical
option might also help.
$endgroup$
add a comment
|
$begingroup$
If you only need the 2D projection images, you can just project the 3D image from the six cardinal directions:
SeedRandom[1234];
P = Graphics3D[RandomColor[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]]
Show[P, ViewPoint -> #] & /@ ∞,0,0, -∞,0,0, 0,∞,0, 0,-∞,0, 0,0,∞, 0,0,-∞
Working with the ViewVertical
option might also help.
$endgroup$
add a comment
|
$begingroup$
If you only need the 2D projection images, you can just project the 3D image from the six cardinal directions:
SeedRandom[1234];
P = Graphics3D[RandomColor[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]]
Show[P, ViewPoint -> #] & /@ ∞,0,0, -∞,0,0, 0,∞,0, 0,-∞,0, 0,0,∞, 0,0,-∞
Working with the ViewVertical
option might also help.
$endgroup$
If you only need the 2D projection images, you can just project the 3D image from the six cardinal directions:
SeedRandom[1234];
P = Graphics3D[RandomColor[], # & /@ Cuboid @@@ RandomReal[0, 1, 10, 2, 3]]
Show[P, ViewPoint -> #] & /@ ∞,0,0, -∞,0,0, 0,∞,0, 0,-∞,0, 0,0,∞, 0,0,-∞
Working with the ViewVertical
option might also help.
answered Jun 3 at 6:16
RomanRoman
16k1 gold badge23 silver badges55 bronze badges
16k1 gold badge23 silver badges55 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f199612%2fhow-to-project-3d-image-in-the-planes-xy-xz-yz%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Possible duplicate: mathematica.stackexchange.com/questions/164663/…. This also seems relevant to the image above, depending on what the dashed lines represent: mathematica.stackexchange.com/questions/45410/…
$endgroup$
– Michael E2
Jun 4 at 0:37