|
|
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
|
|