We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Dear enthusiasts :),
I have been using the Shapes 3D library for one of my projects and I must say it is quite good. However, I had two questions which I could not find an answer to in the forum or in the provided examples in the library’s folder: 1. How to do a hemisphere? I tried manipulating an ellipsoid, but I could not make a hemisphere out of it. Nonetheless, I thought of putting a white cube underneath a sphere and cut it to make it a hemisphere, but then I find that a bit dodgy and hope there is a better way of doing it.
Any help and guidance is appreciated :D.
Answers
The sketch below demonstrates how to use MeshSection to create a hemisphere
Some points to note.
1) Each MeshSection is created for a specific shape, so the number of segments should be the same as the shape plus 1 (See lines 12 & 19)
2) A MeshSection defines the surface area of the shape to be shown. It does not realign the texture.
3) Multiple MeshSections can be added to a shape to draw a discontinuous surface
4) You cannot define the start and end positions of a texture image on an Ellipsoid
I suggest you experiment by changing the values in line 20
With respect to the 'view out of the plane' the usual way to do this is draw the exterior view and then draw the interior surface of the plane on top.
Hi :),
Thank you very much for your reply. I have included my code at the bottom. You can just get rid of the texture codes and use “fill” as I could not attach them. The code should produce an ellipsoid (supposed to be a submarine :)) ) which has a quarter circle as its tale, two cylinders (or tubes) at each side to act as lights, a periscope on top of it and the ellipsoid is being cut by a cube which has only a thickness of 1 units to represent the water level. I am more than happy to share this with everyone, even though it is a bit crude :-S . However, I would really appreciate it if anyone has any ideas and suggestions to improve it. For example I was wondering if one could have a small picture of a flag on the tail or other features such as a door and front windows. Moreover, I did not really understand it when you said this:
Actually I ended up putting a flag on the tail, but to do that I made a thin cube and put the image on it and shifted it on the tail. (I am referring to “box2” object in the code). Please let me know if you have a better suggestion for this. Here is a picture of what I have: http://postimg.org/image/jcsusp9yv/
Many thanks in advance!!
Imagine sitting in the plane but all the plane walls and controls etc are transparent. All you would see is the sky, clouds etc that is the exterior view. So draw that on the screen. Now image that the plane walls are no longer transparent (except for windows open doors etc) and draw that on top of the exterior view.
I understand what you are saying, but I do not think I have done this before ( or maybe I have and I do not know it) :-S . I am not really sure how to go about doing this. Would you please be able to point me to a simple example?
Cheers!! :D
This sketch simply uses 2 images but demonstrates the type of thing I mean. You can download the code and images from OpenProcessing. :)
Beauuutiful! Thanks quark.