PDA

View Full Version : poly normal info



shelby
06-02-2004, 12:33 PM
I am trying to use polynormal() but I am getting some odd results.

I have a four point poly that is facing up on the Y-axis. I run polynormal() and I get a vector <0,1,0>. If I rotate the poly 90 degrees on the Z-axis I get <-1,0,0>. All of this makes perfect sense to me. What does not make sense is when I rotate the poly to something other than 90 degrees. For example, if I rotate it 45 degrees on the Z-axis, from its original position, I would expect to get <-0.5, 0.5, 0>. Instead I get <-.707107, .707107, 0>.

I would greatly appreciate it if someone could explain these unexpected results.

Thanks

Weetos
06-02-2004, 01:20 PM
Actually, it's quite simple :

the vector's length equals one, so when rotated by 45 degrees, its projection on the axis is (sqr2)/2 on each. The values you were expecting (0.5) would mean that the vector length has changed (to sqr(0.5+0.5)=0.707107) once you have rotated it, which isn"t true

hope I made it clear, sorry for my bad english


Weetos

Weetos
06-02-2004, 01:30 PM
maybe this could be better than my bad explanation :)

shelby
06-02-2004, 02:49 PM
I understand now. Thanks for clearing that up.

Lynx3d
06-04-2004, 03:08 PM
Yup it actually follows a sine/cosine function.
On 30 you would get -sin(30) and cos(30), that makes <-0.5, 0.86602..., 0>
(or <sqrt(0.25), sqrt(0.75), 0> to be precise)

objuan
06-10-2004, 04:45 PM
Sounds like you guys might be able to help me with a problem I had. I wanted to rotate a perfectly square cube so that each of it's corner's is intersecting the X Y or Z axis.

I thought it would be like rotate 45 around Y and 45 around Z, but it aint.

I' was able to kind of mess with it till it looked allright, but I would like to know the proper mathmatic appoarch to rotating a cube

Lynx3d
06-11-2004, 07:06 AM
Er...good joke, it's impossible ;)
A cube has 8 corners, and there are 3 dimensions, assuming the origin is inside the cube this makes max. 6 intersections...

Or did i misunderstand what you are trying to do?

Weetos
06-11-2004, 11:08 AM
As Lynx3D said, it's impossible with a cube. you seem to be needing an octohedron (eight faces, six corners), which can be made from a cube by tripling two opposite faces and then welding two opposite points, or by placing 6 points where needed on the axis and creating the eight polygons (tris)

Cheers

Weetos

objuan
06-11-2004, 01:43 PM
:confused: Sorry to be leading everyone on a wild goose chase, that is indeed impossible. So Sorry.

Let me try again:
I have a Qbert feild, One 1x1x1 cube that I cloned offset by 1 in X and 1 in Y, then cloned that stair offset by 1 in X and 1 in Z. So I have kind of a diamond shaped array of cubes going off at an angle, forward, up and right.

How can I rotate that so that it is planar with the ground?