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 imageHow can I transfer colors from first image into second image?Coloring image components according to their areaCircular crop: extract non rectangular parts of an imageHow to convert an uploaded image to a “dot-to-dot” puzzle?Estimate 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?
Subtract the Folded Matrix
Helping ease my back pain by studying 13 hours everyday , even weekends
Are there any individual aliens that have gained superpowers in the Marvel universe?
How much steel armor can you wear and still be able to swim?
Is there any proof that high saturation and contrast makes a picture more appealing in social media?
Why does independence imply zero correlation?
What is the "ls" directory in my home directory?
Why is "Congress shall have power to enforce this article by appropriate legislation" necessary?
How does DC work with natural 20?
Dates on degrees don’t make sense – will people care?
Too early in the morning to have SODA?
Boss wants someone else to lead a project based on the idea I presented to him
Rejecting an offer after accepting it just 10 days from date of joining
Explicit song lyrics checker
Is "Busen" just the area between the breasts?
Cut the gold chain
A word for delight at someone else's failure?
What is the highest voltage from the power supply a Raspberry Pi 3 B can handle without getting damaged?
Why isn't my calculation that we should be able to see the sun well beyond the observable universe valid?
Greeting with "Ho"
Methodology: Writing unit tests for another developer
Justifying Affordable Bespoke Spaceships
Can Hunter's Mark be moved after Silence has been cast on a character?
Draw a symmetric alien head
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 imageHow can I transfer colors from first image into second image?Coloring image components according to their areaCircular crop: extract non rectangular parts of an imageHow to convert an uploaded image to a “dot-to-dot” puzzle?Estimate 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;
$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
3,96821323
3,96821323
asked Jun 2 at 22:24
zeroszeros
7601613
7601613
$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 Textured 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/3.0/"u003ecc by-sa 3.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 Textured 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 Textured 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 Textured 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 Textured 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
199k10226453
199k10226453
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
11.4k11944
11.4k11944
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