[Cg1] Re: [Assignment 1] implementation of equals/unequals operation

Arsène Pérard-Gayot perard at cg.uni-saarland.de
Sat Oct 29 20:00:08 CEST 2016


Hello,

Just a few remarks. I see that you are sharing code in your mail.  
Please do not do it beyond a few lines of code (what you copied is  
fine, for instance).

This also means no public repository (on GitHub or GitLab, etc...).  
Use git only with private repos (you have some for free as a student  
on GitHub, otherwise use BitBucket).

Now, considering your question, think a bit about how the exercises  
are formulated: We ask you to implement operations like +, -, *,  
etc... And we ask you to implement *separately* a "clamp" function.  
Where do you see that we ask you to combine the two?

Best regards,
   Arsène Pérard-Gayot

Noshaba Cheema <s8nochee at stud.uni-saarland.de> a écrit :

> Ok, so I guess this also means that we probably shouldn't implement  
> the RGB operations like this:
>
> RGBColor operator+(const RGBColor& c) const {
>     return RGBColor(r + c.r, g + c.g, b + c.b).clamp();
> }
>
> but rather without the clamp()?
>
> Quoting Pascal Grittmann <s9pagrit at stud.uni-saarland.de>:
>
>> Hi,
>>
>> You should not use any kind of epsilon value here. The == and !=  
>> operators for vectors are usually only used to detect special cases  
>> (e.g. the zero vector), hence you only need (and want) exact  
>> comparisons.
>>
>> Best,
>> Pascal Grittmann
>>
>> Zitat von Noshaba Cheema <s8nochee at stud.uni-saarland.de>:
>>
>>> Hello,
>>>
>>> should we check for the epsilon range in the equals/unequals  
>>> operations or implement them naively?
>>>
>>> _______________________________________________
>>> Cg1 mailing list
>>> Cg1 at cg.uni-saarland.de
>>> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1
>>
>>
>>
>> _______________________________________________
>> Cg1 mailing list
>> Cg1 at cg.uni-saarland.de
>> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1
>
>
>
> _______________________________________________
> Cg1 mailing list
> Cg1 at cg.uni-saarland.de
> http://mail.cg.uni-saarland.de/mailman/listinfo/cg1



Best regards,
   Arsène Pérard-Gayot



More information about the Cg1 mailing list