Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 23/06/2008 at 09:50, xxxxxxxx wrote:
User Information: Cinema 4D Version: 10.5 Platform: Windows ; Language(s) : C++ ;
--------- Hi Folks!
I need your help
I'm working on an ObjectData plugin and I want to set values to an object's surface by placing a texture on it, like it is possible in MoGraphs Shader-Effector. In other words: i want to link a texture-tag, select the channel to be used and then calculate the color of a position on the object's surface.
I've tried it with channel->sample and shader->sample, but both are - in my opinion - independent from the texture-projection. I've also tried GetSurfaceData, but it demands VolumeData, that is not available in an ObjectData plugin, i think. ...or am i totally wrong?
I hope, this question isn't that stupid I'm such a beginner in c++... And i searched a long time, here in the forum, without finding a hint. So it would help me, if you can tell me: a) if it's possible at all b) if theres a example or forum topic i missed c) the general approach or/and d) which functions/classes i should take a closer look at.
Any help would be very appreciated, Cheers, Mark.
On 24/06/2008 at 00:50, xxxxxxxx wrote:
The forum search is your friend. It took me 3 seconds to find an according thread.
Link to other thread
On 24/06/2008 at 01:44, xxxxxxxx wrote:
Hello 3D Designer!
Thank you for your answer But it took me half a day to find this and several similar threads ... and all didn't help me, as i explained above.
In your linked thread "uvw" is a position on the channel, with the range 0 to 1 and not the position on the object's surface ...? Or do i have to convert a global position on object's surface to this "uvw" coordinates? When, how to do this according to the used texture tag and projection method?
Cheers, Mark.
On 24/06/2008 at 01:51, xxxxxxxx wrote:
uvw is the texture coordinate on the objects surface! Simply calculate the uv coordinates of your surface and then fill the ChannelData with it. That´s how it works, that´s how MoGraph is doing it too (I highly assume...maybe if they use a TextureTag as iunput they also take care of the projection, for this look into TexData of the docs, to see how to project the coordinates!).
On 24/06/2008 at 12:03, xxxxxxxx wrote:
Hello 3D Designer,
> Quote: Simply calculate the uv coordinates of your surface and then fill the ChannelData with it. > > * * * > > * * *
I'm uncomfortable to say it, but it's not so "simple" for me Is there a chance, getting a little code-snippet, to understand how i could transfer a global position on a surface into uv coordinates ...? I hope this wish is not too demanding but it would help me a lot.
Thanks for your help, cheers, Mark.