|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have a problem when I'm doing more advanced vectors math (in animation
for example) and some points I'm calculating "by hand" using vrotate etc,
other are calculated by CSG and transformations. THe problem is when I need
to convert between both methods.
Example:
union {
union {
object { MY_OBJECT } // object has center in <0,0,0>
rotate x*90
translate y*clock
// where will be center of MY_OBJECT in here - in this context?
}
rotate z*sin(clock) translate z*clock*2
// where will be center of MY_OBJECT in here - in this context?
}
sphere { position_of_MY_OBJECT_in_this_context 1 }
and I want last sphere to point to center of MY_OBJECT, with is not easy as
it is in other transformations context and I would heve to repeat all CSG
transforamtions manualy to calcaulate that point, with is not very
comfortable.
My suggestion is to allow syntax like:
union {
union {
object { MY_OBJECT }
#declare A = local_point(<0,0,0>);
rotate x*90
translate y*clock
}
#local B = get_vector(A); // point "B" will be a normal vector that will
// not automagicly move like A do
rotate z*sin(clock) translate z*clock*2
}
sphere { get_vector(A) 1 }
This should be very usable i.e. for animations when movment is created by
POV-Ray CSG/macros, not by external program.
Suggested implementation - after declaring local_point, it will automaticly
have all parsed transforms applyed to it.
--
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Rafal 'Raf256' Maj who wrote:
>I have a problem when I'm doing more advanced vectors math (in animation
>for example) and some points I'm calculating "by hand" using vrotate etc,
>other are calculated by CSG and transformations. THe problem is when I need
>to convert between both methods.
>Example:
>
>union {
> union {
> object { MY_OBJECT } // object has center in <0,0,0>
> rotate x*90
> translate y*clock
> // where will be center of MY_OBJECT in here - in this context?
> }
> rotate z*sin(clock) translate z*clock*2
> // where will be center of MY_OBJECT in here - in this context?
>}
>
>sphere { position_of_MY_OBJECT_in_this_context 1 }
>
>and I want last sphere to point to center of MY_OBJECT, with is not easy as
>it is in other transformations context and I would heve to repeat all CSG
>transforamtions manualy to calcaulate that point, with is not very
>comfortable.
You don't have to repeat the transforms, you just have to declare them
separately from the objects that you want to transform, like this:
#declare MOVEMENT = transform {
rotate x*90
translate y*clock
rotate z*sin(clock)
translate z*clock*2
}
union {
union {
object { MY_OBJECT } // The main object moved
transform {MOVEMENT}
}
}
sphere {0,1 transform {MOVEMENT}} // A sphere moved the same way
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
nos### [at] econymdemoncouk news:fb6### [at] econymdemoncouk
> union {
> union {
> object { MY_OBJECT } // The main object moved
> transform {MOVEMENT}
> }
> }
> sphere {0,1 transform {MOVEMENT}} // A sphere moved the same way
But what if:
union {
union {
difference {
union {
object { MY_OBJECT }
transforms
}
transforms
}
transforms
}
transforms
}
> sphere {0,1 transform {MOVEMENT}} // A sphere moved the same way
But I need a wector - so that I can do mathematic calculations on it (i.e.
interpolate it, write it to file, etcP
--
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> But what if:
>
> union {
> union {
> difference {
> union {
> object { MY_OBJECT }
> transforms
> }
> transforms
> }
> transforms
> }
> transforms
> }
You may have to declare all of the transformations separately. If you want,
you can keep them all in place like this:
union {
union {
difference {
union {
object { MY_OBJECT }
#declare trans1 = transform{...}
transform{trans1}
}
#declare trans2 = transform{...}
transform{trans2}
}
#declare trans3 = transform{...}
transform{trans3}
}
#declare trans4 = transform{...}
transform{trans4}
}
> But I need a wector - so that I can do mathematic calculations on it (i.e.
> interpolate it, write it to file, etcP
#declare MyVector = vtransform(MyVector, trans1); // (repeat for other
transformations)
- Slime
[ http://www.slimeland.com/ ]
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
fak### [at] emailaddress news:410d3a09@news.povray.org
> #declare MyVector = vtransform(MyVector, trans1); // (repeat for other
> transformations)
Thanks, that almost perfect solution :)
--
http://www.raf256.com/3d/
Rafal Maj 'Raf256', home page - http://www.raf256.com/me/
Computer Graphics
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |