3 threads found!
Thread | Author | Replies | Views | Last Reply |
---|---|---|---|---|
wealthychef | 2 | 2077 | ||
wealthychef | 7 | 309 | ||
wealthychef | 1 | 2124 |
5 comments found!
Found a solution thanks to http://mcngraphics.com/thelab/blender/connect/
def FindRotation(ep1, ep2):
ep1 = numpy.array(ep1)
ep2 = numpy.array(ep2)
center = ep1 + 0.5 * (ep2 - ep1)
ep2new = ep2 - center
r = numpy.linalg.norm(ep2new) # radius of sphere
theta = math.acos(ep2new[2]/r)
phi = math.atan2( ep2new[1], ep2new[0])
return (0,theta, phi)
Thread: Blender python: Creating a cylinder given two endpoints and a radius | Forum: Blender
Tough one, eh? :-) I've googled all over the place, and I've found some code, but it does not work. that is, the resulting quaternion, when used as obj.rotate_quaternion, does not result in properly rotated cylinder with ep1 = (0,0,0) and ep1 = (0,100,0)
def FindRotation(ep1, ep2):
vec = numpy.array(ep2) - numpy.array(ep1)
if not vec[0] and not vec[1]:
return (0,0,0)
print ("vec: %s"%str(vec))
Z = numpy.array((0,0,1))
kcostheta = numpy.dot(Z, vec)
k = Length(vec) # sqrt(Length(vec)^2 * Length(Z)^2) = Length(vec)
Q = Quaternion(numpy.cross(vec,Z), kcostheta+k)
Q.normalize()
print ("kcostheta: %f, k: %f, Q: %s"%(kcostheta, k, str(Q)))
return Q
Thread: Newbie trying to put up a background image | Forum: Blender
Quote - Input>Texture Coordinate (Generated, Window, or Camera) plugged into Vector>Mapping, which is then plugged into the vector socket on your image texture. X and Y scaling settings should do the job. Other adjustments of interest are Z-rotation and X and Y location.
Sounds excellent, I'll try that too. What is working very well in my case now was to create a hexahedron (anisotropically scaled cube) around my scene and texture an image onto it. Gives exactly the effect I want for my project.
Thread: Newbie trying to put up a background image | Forum: Blender
However, this does NOT tile the image. Anyone know how I can tile the image acroos the background instead of having a huge image?
Thread: Newbie trying to put up a background image | Forum: Blender
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Thread: Blender python: Creating a cylinder given two endpoints and a radius | Forum: Blender