1

Topic: The shade - is owed by object or a lamp?

There is 3D an object, and a lamp. They . And still there is a shade. The shade should know about object that , but she also should know about a light source, where it and what characteristics at it. Where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. A question not in how to make. And in that as on beauty from the point of view of OOP.

2

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> Where it is better to thrust a shade on design? SO> a question not in how to make. And in that as on beauty from the point of view of OOP. To thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way.

3

Re: The shade - is owed by object or a lamp?

Hello, neFormal, you wrote: F> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. Too much cross  links. It is possible certainly for bluntly all objects to throw the pointer on a scene, and the scene knows all. But somehow it is not beautiful.  it is possible more beautifully?

4

Re: The shade - is owed by object or a lamp?

Hello, neFormal, you wrote: F> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. There can be some objects accepting a shade from one. And on the contrary, on one object other objects can  shades some. And still the object can  a shade on itself, if it nonconvex.

5

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . And still there is a shade. SO> the shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. In a scene (or in object specially trained for this purpose) which knows both about a lamp, and about object.

6

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . And still there is a shade. SO> the shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. SO> a question not in how to make. And in that as on beauty from the point of view of OOP. And it here is necessary ? Generally on idea it not a shade , and the third object illuminated by a lamp.

7

Re: The shade - is owed by object or a lamp?

Hello, V. Zudin, you wrote: SVZ> In a scene (or in object specially trained for this purpose) which knows both about a lamp, and about object. This first decision which occurs. It would be desirable to hear sentences,  who of that non-standard offers.

8

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> This first decision which occurs. It would be desirable to hear sentences,  who of that non-standard offers. What for to you non-standard? Generally light sources, objects  a shade and objects accepting a shade can move from a frame to a frame. If at you each object contains collections of all light sources, all objects which  on it a shade, and-or all objects which accept from it a shade in each frame it is necessary to update these collections.

9

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . And still there is a shade. It is always pleasant to hear about objects which are drawn, register in a DB, about operation. Be fulfilled (), . Be replenished (), beer. Be drunk (), the earth. Dig (). SO> the Shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. Dealt 3D in 2000 a little. It seems to me that in the task  shades questions on where it to thrust - not in first ten urgency. At all I do not remember that in 3D packets at scenes there would be objects "shade" as those. SO> a question not in how to make. And in that as on beauty from the point of view of OOP. From the point of view  OOP where a shade - the successor of object of a scene, all is just beautiful. I.e. If the task consists what to make beautiful the OOP, here hardly one decision something will be better than another. But if it all the same has to be drawn, I suggest to pass from design OOP to methods. Generally a question from a category "who will draw a hole from a donut?, a donut, or what through it is visible?".

10

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . And still there is a shade. SO> the shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. SO> a question not in how to make. And in that as on beauty from the point of view of OOP. From the point of view of beauty of OOP you have a scene with several light sources. The scene knows both about a lamp and about a subject on paths of light and about a subject on which light falls.

11

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> the Question not in how to make. And in that as on beauty from the point of view of OOP. In  the specific approaches: https://en.wikipedia.org/wiki/Entity%E2 … 0%93system There not on the first place, the main thing of 60 times and it is more for second all to fulfill OOP (and if it is necessary - to a shade to disconnect).

12

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> the Question not in how to make. And in that as on beauty from the point of view of OOP. There is there no OOP and it is not necessary there. All correctly write about a scene. The lamp and object are a data, something passive, they are processed by a scene.

13

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: F>> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. SO> too much cross  links. It is possible certainly for bluntly all objects to throw the pointer on a scene, and the scene knows all. But somehow it is not beautiful.  it is possible more beautifully? For each point it is necessary to know a level of its shadowing. If the point too is object in sense of OOP it is necessary to know by whom it is closed from a light source and what reflexes receives. Receive it it can from a scene environmental it. Basically, each object can estimate area which it covers with a shade and  on this array of points any event. A pier, "enumerate lighting". It is possible to do it even through the bus of messages.

14

Re: The shade - is owed by object or a lamp?

Hello, Qbit86, you wrote: F>> to thrust in object on which the shade falls. He should learn the nobility about a lamp and objects on light way. Q> there can be some objects accepting a shade from one. Therefore each object itself looks, by whom it is closed from light Q> And on the contrary, on one object other objects can  shades some. Each object finds all closing it from light sources objects Q> And still the object can  a shade on itself, if it nonconvex. With it already more difficult and here operation is transferred to points

15

Re: The shade - is owed by object or a lamp?

Hello, SergeyOsipov, you wrote: SO> There is 3D an object, and a lamp. They . They not . A lamp (in sense of a light source) it is exact. Basically it is not possible "" any object. It is possible to calculate only reflected light which proceeds in particular and from this object. SO> and still there is a shade. And the shade is not present. There is reflect or not so light. SO> the shade should know about object that , but she also should know about a light source, where it and what characteristics at it. SO> where it is better to thrust a shade on design? In object? But whereas to anchor a lamp? In a lamp? But then the lamp should know about all objects. But if to return to realities of approximate models and to admit that objects  it is possible to walk on objects, considering light, and  new temporal which will be these shades (fragments of glass with a different transparency), then  everything, and shades to except in a cache to the following time, or  if something exchanged. SO> a question not in how to make. And in that as on beauty from the point of view of OOP.

16

Re: The shade - is owed by object or a lamp?

Hello, Vladek, you wrote: V> In  the specific approaches: https://en.wikipedia.org/wiki/Entity%E2 … 0%93system V> There not on the first place, the main thing of 60 times and it is more for second all to fulfill OOP (and if it is necessary - to a shade to disconnect). Entity-Component-System it is the specific approach, it is possible to tell an architectural pattern and it at all does not contradict OOP. OOP is necessary not for inheritance-encapsulation-polymorphism, and for control of complexity of the decision. I.e. decision structurization. As soon as you solved the task, it needs to be translated in the code. Here also starts to work as OOP. And Entity-Component-System it is already specific variant of design. Actually in  the cleanest OOP got accustomed - objects consist of objects, interact with other objects by means of messages and . An interaction Special case - control as becomes by means of messages. From here it is clear that methods are anchored to the object or not anchored it for OOP business the tenth, strangely enough. That is, takeDamege (entity) and entity.takeDamege () are absolutely equivalent.

17

Re: The shade - is owed by object or a lamp?

I> Actually in  the cleanest OOP got accustomed - objects consist of objects, interact with other objects by means of messages and . An interaction Special case - control as becomes by means of messages. I> from here it is clear that methods are anchored to the object or not anchored it for OOP business the tenth, strangely enough. That is, takeDamege (entity) and entity.takeDamege () are absolutely equivalent. On all remaining yes, and here by an example - is not present (or overpersuade, please) For me OOP it in the core not about  objects and how they exchange, and that "the code near to given", i.e. actually "data" is not present, is all "is incapsulated". And here between takeDamege (entity) and entity.takeDamege () a difference . I do not want to tell that takeDamege (entity) it badly, simply difference is, and if in mine  "to accept damages" is "in the nature" the object (instead of simply private scenario  with it) I will prefer entity.takeDamege ()

18

Re: The shade - is owed by object or a lamp?

Hello, ylem, you wrote: I>> From here it is clear that methods are anchored to the object or not anchored it for OOP business the tenth, strangely enough. That is, takeDamege (entity) and entity.takeDamege () are absolutely equivalent. Y> on all remaining yes, and here by an example - is not present (or overpersuade, please) Y> For me OOP it in the core not about  objects and how they exchange, and that "the code near to given", i.e. actually "data" is not present, is all "is incapsulated". Y> And here between takeDamege (entity) and entity.takeDamege () a difference . I do not want to tell that takeDamege (entity) it badly, simply difference is, and if in mine  "to accept damages" is "in the nature" the object (instead of simply private scenario  with it) I will prefer entity.takeDamege () and if "in the nature" the object there is a possibility to change "health" f-tsija takeDamage (entity) will do entity.decreaseHp (n), and f-tsija heal (entity) will do entity.increaseHp (n)

19

Re: The shade - is owed by object or a lamp?

F> and if "in the nature" the object there is a possibility to change "health" f-tsija takeDamage (entity) will do entity.decreaseHp (n), and f-tsija heal (entity) will do entity.increaseHp (n) And besides, I would prefer not to change health outside so explicitly because, for example, at any  generally there is no health in the usual sense or somebody treat-nelechi, all .

20

Re: The shade - is owed by object or a lamp?

Hello, Ikemefula, you wrote: I> Hello, Vladek, you wrote: V>> In  the specific approaches: https://en.wikipedia.org/wiki/Entity%E2 … 0%93system V>> There not on the first place, the main thing of 60 times and it is more for second all to fulfill OOP (and if it is necessary - to a shade to disconnect). I> Entity-Component-System it is the specific approach, it is possible to tell an architectural pattern and it at all does not contradict OOP. I> OOP is necessary not for inheritance-encapsulation-polymorphism, and for control of complexity of the decision. I.e. decision structurization. I> as soon as you solved the task, it needs to be translated in the code. Here also starts to work as OOP. And Entity-Component-System it is already specific variant of design. I> actually in  the cleanest OOP got accustomed - objects consist of objects, interact with other objects by means of messages and . An interaction Special case - control as becomes by means of messages. It is implementation of game business logic, and we about  speak.

21

Re: The shade - is owed by object or a lamp?

Hello, ylem, you wrote: F>> and if "in the nature" the object there is a possibility to change "health" f-tsija takeDamage (entity) will do entity.decreaseHp (n), and f-tsija heal (entity) will do entity.increaseHp (n) Y> And besides, I would prefer not to change health outside so explicitly because, for example, at any  generally there is no health in the usual sense or somebody treat-nelechi, all . It already depends on the approach. Nothing hinders to make empty implementation of a method. And if there also entity component system with HealthComponent only inc/dec also remain.

22

Re: The shade - is owed by object or a lamp?

F> nothing hinders to make empty implementation of a method. And if there also entity component system with HealthComponent only inc/dec also remain. All the same went to read about ECS. Thanks.