Thursday, June 30, 2016

mathematics - Are there 3D projections other than orthographic and perspective?



The question is pretty much in the title. Are there notable 3D projections other than orthographic and perspective that could be used in a 3D system such as OpenGL?


In particular, are there any that have a particular use in game design?



Answer



Yes, To name a few:



The Pannini projection, for example, can capture wide fields of view in nice ways. (totally just my opinion)


I think implementation details would be beyond the scope of this specific question.





EDIT: Thanks for the comment, I did misspell Pannini. And to make this edit worthwhile here are a few more:



  • Paraboloid / Dual-Paraboloid (Useful for reflections, shadows, stained glass)

  • Equirectangular (Can produce a world map view of a sphere)

  • Spherical

  • Sinusoidal


meaning - What does the phrase 'take your time by me' mean?


Passage:




Arms bending and stretching!' she rapped out. 'Take your time by me. One, two, three, four! One, two, three, four! Come on, comrades, put a bit of life into it!



(George Orwell 1984)


Question:



What does the phrase 'take your time by me' mean?



Link to the book (page #40)



Answer



Judging by the repeated counting from one to four afterwards, this is an instruction to follow the tempo, or rhythm, set by the speaker.



Is Carmack right about PC performance? And does Windows 8 address his concerns?


Here John Carmack claims that PCs are still slower that current gen console hardware because of the overhead.



"A lot of it's driver overhead issues, where there's so much that we do in the game, all of this dynamic texture updating where on the console we say 'alright, we've got a new page of data', we put that page in and update the page table that points to that.


"On the console that may just be a matter of writing it to memory, it's like 'here's the texture, let's calculate exactly where this part of the page table is' and then we just poke it right in there," he explained.




Is the situation really that dire? And are there any features or changes in Windows 8 planed that will improve the current state of the PC Gaming ?



Answer



Console: static hardware that never varies across every single iteration. Home PC: hardware that changes from day to day, with a million different chip designs.


Console: closed system that lives in its own, secure environment from birth to death. Home PC: wild west, barroom brawls and your OS is the sheriff keeping everyone from getting shot.


Carmack: writing a system that depends on slinging around large texture blocks and is apparently sad that he doesn't get to personally write a hardware interface to every single graphics chip and OS variant from the last 5 years. Not to mention that he also apparently wants to give customer support to millions of people, hundreds of thousands of whom will have some kind of compatibility issue that Id must solve for them.


What's there to improve, given that on home PCs you have to support tens of different chipsets that have to work flawlessly against millions of programs written across the past decade or more? Personally I think that it's a miracle that the house of cards keeps standing!


Not much of an answer I know, but PC gaming is actually quite good and easy to develop for outside of certain esoteric optimization issues. A better question might be why are consoles so extremely limited?


sentence meaning - How do native speakers say condolences to someone else (especially in AmE)?


In my mother language, when someone dies, friends and family usually try to say their condolences to everyone who is suffering from that loss. What we say is as follows:



I say condolences to you.




I've Googled and found just 7 hits with the above sentence. It seems that there is something wrong with my sentence. How would native speakers say this, especially in AmE?



Answer



"I am very sorry for your loss," is probably most common. You can elaborate if you wish, but otherwise this is simple and sufficient, especially if you are not very close to either the bereaved or the deceased.


xna 4.0 - XNA change a specific color of a model to another


Is it possible to change a specific color of a model to another?


Example:


Everything that's blue should be red or something like that.


And is it possible to do this without the use of effects? I still want to use the basic effect.




verb forms - When do we double the consonant before '-ing' affix?


My son is learning how to spell. He is doing a good job listening to sounds and working out spelling that way (which doesn't work for many words, but at least a lot of common ones), but although he's gotten the -ing chunk, he frequently misses doubling letters in these words.


Is there a guideline for when the end consonant is doubled? He's working on these sorts of words:





  • riding

  • sitting

  • skating

  • writing

  • getting




Answer




Are they still teaching the old 'long/short' vowels? If so, here's the rule:



If the syllable before the /-ing/ is pronounced with a 'long' vowel, leave the final consonant single (and delete any final silent /e/)
If it's pronounced with a 'short' vowel, double the final consonant.



It may help make this clearer if you explain that a vowel before a doubled consonant is (almost) always short. Then write the /-ing/ forms out 'wrong' and invite your son to pronounce them the way they look:


ride   ridding
sit siting
skate skatting
write writting

get geting

As Renan points out, it gets more complicated when the final syllable of the base form is unstressed; but it looks like your son hasn't gotten that far yet.


Rule / validation design pattern


What design patterns can be used to create a rule / validation system for a game like chess (this is just a simple example, the actual game needs more difficult sets of rules)


I've read several questions on this site and haven't found a conclusive answer nor an answer pointing me in the right direction.


This system would require the following:



  • Every object that has rules applied to it should implement a specific interface with a method that is the starting point for the validation

  • The rule should be applied in 2 steps: first, it needs to be validated (can pawn A move to square D4), if true then execute method A if false then execute method B

  • Every object can have multiple rules that need to be applied in a specific sequence. When rule 1 is finished, rule 2 should then start to validate etc


  • Every separate rule (for example: can only move 1 square, can only move diagonally etc) must be in its own class and must be reusable and applicable on the objects that need rules.

  • Note this is going to be used in a multiplayer game on the backend

  • Note that every rule need multiple objects to test its validity, for example, normally a pawn can move 1 square, now the next sqaure on the gameboard is filled by a pawn of your opponent. Result: your pawn cannot move. The pawn should include the other pawns positions, or the gameboard in its validation.


Another word for these rules would be behavioral limits.



Answer



Think of a game as a sequence of states, separated by moves. Every time a player makes a move, a new state is generated.


enter image description here
(It's like this XKCD comic!)




Create a class Move, which represents one move made by one player. (In Reversi, a sufficient description is one set of board coordinates where a piece is to be placed. In Chess, an origin and destination coordinate are sufficient.)


Create a class GameState, which represents the state of the game at any one time. (In Reversi, a sufficient description would be the board's contents and which player's turn it is. In Chess, you'd additionally need to store whether it is still possible for each player to castle kingside or queenside.)


Now, you can probably imagine the GameState having an isMoveLegal(Move) method. After all, it contains all the information it needs to make that decision.



This design cleanly isolates the rule logic, reducing inter-component dependencies.


It also makes AI easy! You can trivially generate all possible moves from a GameState, check if they're legal, generate more GameStates from those and basically build a tree that you can use for minimax, perhaps with alpha-beta pruning.


terminology - What a face/facet of a cardboard box is called? a piece of wall?


In geometry, a cube is a three-dimensional solid object bounded by six square faces, facets or sides, with three meeting at each vertex. A cardboard box could be viewed as a cube.


enter image description here


A cube has 6 faces, 12 edges, and 8 vertices. What a face/facet of a cardboard box is called in daily life? a piece of wall?



Answer



People refer to a side or wall of the box, the top and the bottom.



They might be more specific by talking about the longer or shorter side/wall.


The bits at the top and the bottom that tuck in to seal the box are called the flaps.


https://www.google.com/search?client=firefox-b-d&q=cardboard+box+flaps https://www.themanufacturer.com/articles/how-a-cardboard-box-is-made/


unity - How to rotate object just like in the scene?


Look at this image, I selected an object and pivot is set to local:


enter image description here


When I rotated selected object in the scene by X axis, it rotates exactly I wanted.


enter image description here


But if I rotate axis from inspector or script, it doesn't rotated to desired angle.


I'm not sure, but it seems it's related about Quaternion, but everything I tried doesn't worked well.


How do I rotate that object just like in rotated from scene?




Answer



The (local) transform gizmo shows you rings of possible rotations from the current orientation, about the current local x, y, and z axes respectively.


The Inspector / transform.localEulerAngles property show you the current local orientation expressed as Tait-Bryan angles (commonly called Euler angles) with x, y, and z components.


These are not the same thing.


Tait-Bryan angles are not a point in rotation space. They're directions for how to get there. In Unity's formulation, they say:




  1. Starting from the default/identity orientation





  2. Rotate y degrees clockwise around your local y+ axis
    (note that this turns the local x & z axes)




  3. Next, rotate x degrees clockwise around your new local x+ axis
    (note that this turns the local y & z axes)




  4. Finally, rotate z degrees clockwise around your new local z+ axis





So the y rotation always happens first and z rotation always happens last. (If you think of the rotations as local-space. If you think of them in parent space, the order is reversed but the result is the same)


But using the transform gizmo, you can grab & turn the green & blue rings in any order you want, or even interleave them. Three numeric fields aren't enough to specify this kind of interleaving, at least not alone.


If you want to get the result of turning the green (y+) gizmo in local mode no matter what orientation you're starting from, in code you can write any of these equivalent expressions:



  • transform.Rotate(Vector3.up, yawAngle)

  • transform.Rotate(0, yawAngle, 0);

  • transform.Rotate(transform.up, yawAngle, Space.World);

  • transform.rotation = transform.rotation * Quaternion.AngleAxis(yawAngle, Vector3.up)



  • transform.rotation = transform.rotation * Quaternion.Euler(0, yawAngle, 0)




  • transform.rotation = Quaternion.AngleAxis(yawAngle, transform.up) * transform.rotation;




Wednesday, June 29, 2016

modal verbs - "should" could be inverted in affirmative or some type of condition sentences




  1. Should anyone phone, tell him I'm busy.

  2. If anyone phones, tell him I'm busy.



I am wondering what is the difference between those?


What is more, I am wondering as to the inversion in the first sentence has happened. Would you please show me a site so that I could study more about such a specific inversion?




Answer




If anyone calls, tell him I am busy.


If anyone should call, tell him I am busy.



Now what is the difference between this two?


The first one is a normal conditional sentence, while the second one suggests that the event of calling is unlikely.


Notes from Practical English Usage by Michael Swan -


enter image description here


enter image description here




Should anyone call, tell him I am busy.



We can re-write this sentence as the following -



If anyone should call, tell him I am busy.



Note in the previous case Should anyone call...., we don't use calls.


Please visit this link for more information and examples of should used at the beginning of the sentence with if dropped, as you quoted in your question.


N.B Pam Peters in Cambridge Guide to English Usage suggests that the usage of should in conditional sentence is becoming less often. Conditional uses of should with if included in sentence now sound rather lofty, but the inverted should at the beginning of the sentence with no if included in that clause is still a neat way of prefacing a condition.



xna - Deferred lighting and projective texturing?


Is posible to use this technique with deferred lighting?



Answer



What does the projected texture represent? Projective texturing is a means of generating texture coordinates from vertex positions, to make it appear that the texture is projected over the scene like a film projector.


Can you still do these computations in deferred rendering? Yes. But when and how you do it depends on what the values in the texture represent?


Projective textures are often used to represent things like flashlights. In which case, the texel values are light intensities. And that means you need to do the projection during the lighting pass. Once you reconstruct the position of the particular screen pixel, just do the usual projection computation.



If the projective texture alters the albedo (diffuse reflectance, or diffuse color) of the object, then this must be done in the G-buffer pass. There, you can do the projection computations per-fragment or per-vertex, but you'll get better results per-fragment.


passive voice - "The shop opened by" vs "The shop was opened by"


Are these statements correct? and What are the tenses of the following sentences?


The shop opened



... while the shop opened by James Booth and taken over by Arthur Simpson in 1909 has long gone. Daily Telegraph



The shop was opened




In 1921 it opened its first dedicated shop in London’s Oxford Street. Known as HMV – an acronym for His Master’s Voice – the shop was opened by Sir Edward Elgar. Daily Mail




Answer




. . . the shop (opened by James Booth and taken over by Arthur Simpson in 1909) has long gone. 



In this clause, the only verb that has a tense is "has".  The three other verbs are non-finite forms: "opened", "taken" and "gone".  The traditional name for this non-finite form is past participle.  That's a confusing name because the past participle has nothing to do with the past tense. 


We can consider "has gone" as a coherent verb phrase in the active voice, present tense, perfect aspect and indicative mode.  You may have been taught to call this the present perfect tense.  I find it easier to understand tense (past, present, and maybe future) and aspect (simple or indefinite, continuous, and perfect) as separate properties instead of lumping them both under the name tense


Both "opened by James Booth" and "taken over by Arthur Simpson in 1909" are participial phrases.  There are at least two ways of explaining how they work. 


The way that I prefer is to say that participial phrases can do the same job that adjectives do.  In this case, they directly modify the noun "shop". 



The explanation that seems to be more common on this site is to say that they are reduced relative clauses.  In this case, there are a number of words missing -- "opened by James Booth" is taken to mean "[ [which/that] [is/was/has been/had been/etc.] ] opened by James Booth". 


In the end, the difference between these two explanations is small.  If we think of "opened by James Booth" as an adjectival participial phrase, then it has no tense in the same way that the adjective "happy" has no tense.  If we think of it as a reduced relative clause, then its tense is unknown because the words that would mark the tense are missing. 


The phrase "the shop opened by James Booth" does not stand as an independent clause in this context.  That may be hard to see because "opened" is both the past tense form and the perfect aspect form (or past participle form).  The participles "taken" and "gone" are easier to recognize because they are distinct from the past tense form "took" and "went". 




. . . the shop was opened by Sir Edward Elgar. 



This is a past tense construction.  Specifically, it is in the passive voice, past tense, indefinite aspect and indicative mode.  The verb phrase is "was opened".  The finite verb "was" marks the past tense and licenses the passive voice.  The participle "opened" fulfills the passive voice license. 


If we want to express both the passive voice and the perfect aspect, we would need to use two so-called past participles, one for each purpose.  For example:




The shop had been opened. 



Here, the "had" marks the past tense and licenses the perfect aspect.  The "been" fulfills the perfect aspect license and in turn licenses the passive voice.  Finally, the "opened" fulfills the passive voice license. 


complementation - to show (object) do something -- grammatical construction


Example with a context:



The clip clearly shows the fully armed Russian Su-27 approach the surveillance plane from the starboard side (at a safe distance), use the air brake to slow down, and then break away.



First of all, if we changed the sentence above to the clip clearly shows the fully armed Russian Su-27 approaching..., would it still mean the same thing?


Secondly, is that how we always use that construction? I mean, we always use a bare infinitive after the object of "show" to tell what action it's doing? If so, is the following example correct:



The footage shows two street toughs approach and rob a man.





Answer




The clip clearly shows the fully armed Russian Su-27 approach the surveillance plane from the starboard side (at a safe distance), use the air brake to slow down, and then break away.



This construction, verb + object + bare infinitive, is usually used with verbs of perception: see, hear, notice, watch. But these verbs of perception can also be followed by the ing form, as you proposed.


There would be a slight difference in meaning. Let me quote from BBC:



There is often, however, a slight difference in meaning. If we use the verb-ing form, there is a suggestion that we are witnessing the event in progress, whereas if we use the bare infinitive, this suggests that we can hear or see the complete action or event. Compare the following:


As I passed their classroom, I could hear them whispering inside.

At the party, I heard Sue whisper to Tom: "Let's get our of here before Barry arrives."


I watched Henman play Hewitt in the men's singles semi-final at Wimbledon
I saw them playing in the garden, but I didn't take much notice.



There's also a nice page at the Oxford Dictionary: Hear, see, etc. + object + infinitive or -ing:



He saw her drive off with a young man in the passenger seat. (The speaker observed the whole event.)
Maria heard him coming up the stairs towards her room, and felt scared. (The action was in progress, happening, but not completed)



Another interesting note:




The -ing form can also emphasise that an action or event is repeated:
We watched them running back and forth, loading and unloading the trucks and taking boxes in and out of the building.
After can or could with one of these verbs, we always use the -ing form, not the infinitive:
I can hear people talking. They must be in the next room.



And an interesting quote borrowed from one forum, a quote from "Explaining English Grammar" by George Yule:



One final puzzle exists with regard to why we use the bare infinitive and not the to-infinitive, with sensory perception verbs. This puzzle may be explained by referring to a phenomenon already noted with other features of English. There seems to be a recurring pattern in English whereby LINGUISTIC DISTANCe reflects CONCEPTUAL DISTANCE. The more linguistic material between two forms, the less connected are the actions or events designated by those forms. When two actions are perceptually separate, the to element comes between the main verb and the infinitive form (e.g I told her to leave). When the perception is at exactly the same time as the action, there is no separation of the two actions, and so the to element does not come between the verbs (e.g I saw her leave). The same observation applies to perception verbs with the gerund, where there is no marked separation of perception and action (e.g I saw her leaving). Less conceptual distance is reflected in less linguistic distance.
In the extended (non-literal) uses of perception verbs, when the meaning is not about immediate sensory perception of an action, quite a lot of linguistic distance can be placed between the main verb and the second verb. In such cases, finite that-clauses of the type shown in /29/ are common:



/29/ a. I see that we've reached the end of the chapter.
b. Yes, but I hear that he's included projects and other topics.





So, your example sentence puts more stress on the "completeness" of the approach sequence: the plane was at some considerable distance, then it approached to being near the P3-Orion. Compare:



The clip shows the Su-27 approaching the P3-Orion, but at the moment then the two planes are separated by some 300 meters the recording abruptly ends. (this sentence would probably look worse with approach)



The verb to show in "the clip clearly shows" is not exactly a verb of perception, and probably because of this the combination of "shows him approach" is not seen in Google Ngram and brings up only a handful of results at Google. Here's the link to an Ngram comparing "shows him approach" and "saw him approach".


zero results for



Maybe due to this it would be better to rephrase using a perception verb:



Watching this clip, one sees the fully armed Russian Su-27 approach the surveillance plane from the starboard side (at a safe distance), use the air brake to slow down, and then break away.



But I'm not sure; to my non-native eye the original sentence looks passable.




Related:



genderless pronouns - 3rd person singular (he or she)


I see sentences with (he or she) like :



How to know if he or she is the best one for you?


Give a Person Power and He or She Will Show Interpersonal Sensitivity.



It's possible to use just one word instead of (he or she), something like :




Give a Person Power and He Will Show Interpersonal Sensitivity




Answer



One would typically say:


"Give a Person Power and They Will Show Interpersonal Sensitivity"


"They" being specifically gender neutral.


graphics - What are normal, tangent and binormal vectors and how are they used?


I would like to find out the following information:



  • What are they?


  • Example usage in game development (the area they are used in)


About the following vector types:



  • Normal

  • Tangent

  • Binormal


A simple game development centric explanation would suffice.



Answer




Generally speaking, a Normal vector represents the direction pointing directly "out" from a surface, meaning it is orthogonal (at 90 degree angles to) any vector which is coplanar with (in the case of a flat surface) or tangent to (in the case of a non-flat surface) the surface at a given point.


A Tangent vector is typically regarded as one vector that exists within the surface's plane (for a flat surface) or which lies tangent to a reference point on a curved surface (ie. if a flat plane were constructed with the same normal from the reference point, the tangent vector would be coplanar with that plane).


The concept of a Binormal vector is a bit more complex; in computer graphics, it generally refers to a Bitangent vector (reference here), which is effectively the "other" tangent vector for the surface, which is orthogonal to both the Normal vector and the chosen Tangent vector.Normal, Tangent, Bitangent


With regards to how they are computed, this varies depending on the complexity of the surface and how precise you want the normal to be (in some cases, such as with smooth shaders, it is more desirable to calculate a normal for an approximated surface, when the actual information for a surface is not present), but there are several generalized formulas given here.


In terms of where they occur, the answer is EVERYWHERE. Normal vectors are used to position cameras and objects in 3D space, to determine trajectories, reflections, and angles in physics calculations, to map skins and textures to 3D models, to determine aim trajectory offsets in AI programming, to give hints to shaders about how to light, shade, and color points on a surface relative to lights, the camera, and other objects, and so on. They are possibly one of the most useful pieces of information to have in a 3D environment, and they even come in extremely handy in 2D as well.


Can I use an infinitive with the verb 'recommend'?


According to this source the verb 'recommend' can be used only with a gerund, but I've found some examples with an infinitive:




1) We recommend you to update your browser


2) We recommend you to use REGULAR ELICINA that does not contain any moisturizers, which is good for it will avoid the greasiness of the skin


3) We recommend you to check the privacy policies of such service providers to understand how they process your location data


4) If your plans are to apply for a permanent visa, Escalar recommend you to contact with Arrive Australia Migration Services for additional information


5) To avoid the Megaproject Paradox, we recommend you to study the points described above, and report your management and Sponsors



Question:



Can I use an infinitive with the verb 'recommend'?





Answer



All of those examples sound somewhat strange to me, and several of them contain other grammatical errors that suggest they were not composed by a native speaker. The recommend you to... construction is marginal compared to recommend that you..., as you can see from this Google Ngrams chart.


I've rewritten below the sentences as I would prefer them, with my changes highlighted.



We recommend that you update your browser


We recommend that you use REGULAR ELICINA, which does not contain any moisturizers, which is good for it will avoid the greasiness of the skin



It's more natural in this sentence to use a relative clause beginning with which than with that, since the clause seems to contribute additional information rather than specify a particular entity, like in the noun phrase the man that I saw, where that I saw helps you pick out exactly which man I'm talking about.




3) We recommend that you check the privacy policies of such service providers to understand how they process your location data


4) If your plans are to apply for a permanent visa, Escalar recommends that you contact Arrive Australia Migration Services for additional information



You can contact someone, but it sounds decidedly strange to contact with someone, so I've deleted that preposition from the original sentence.



5) To avoid the Megaproject Paradox, we recommend that you study the points described above, and report to your management and sponsors



It looks like this sentence is incomplete so I'm not sure what it's supposed to be, but it seems like it should be report to your management and sponsors and not report your management and sponsors. The noun sponsors should not be capitalized.


Note that these judgments are strictly for American English and I cannot comment on how these sentences fare in other varieties of English.


Monday, June 27, 2016

past perfect - "He had had his nap" or "he had his nap"?


I am reading Jonathan Franzen's The Corrections, and I came across this sentence:



He'd had his nap and there would be no local news until five o'clock.




Why did Franzen choose to write the sentence using the past perfect instead of the simple past? My understanding of past perfect is that it is only used to denote an event in the past that occurred before another event. Should I consider the "local news until five o'clock" as that latter event?


I know that the past perfect subjunctive of "have" is "had had," but I do not believe that he is conveying that mood.



Answer



You need the larger context:



Three in the afternoon was a time of danger in these gerontocratic suburbs of St. Jude. Alfred had awakened in the great blue chair in which he'd been sleeping since lunch. He'd had his nap and there would be no local news until five o'clock. Two empty hours were a sinus in which infections bred.



Reference Time for this past perfect is introduced at the beginning of the paragraph: three in the afternoon. At some time before that Alfred had awakened; he had had his nap, so now he had no mindless activity left to occupy the two empty hours between Reference Time, three o'clock, and the next mindless activity, the local news, at five o'clock.


sentence construction - Follow the antecedent, Adjective Clauses


Writing Academic English


According to this book, the first two highlighted sentences, to avoid confusion, an adjective clause should follow its antecedent, but there are some occasion that some words may come between the antecedent and the adjective clause.


I wonder on what occasion can we insert words between an adjective clause and antecedent. Is it proper to write in this way?


Thank you!


Thank you!




Answer



The simple answer is that you can place the clause anywhere that avoids ambiguity.


The example that your book gives, where the placement changes the meaning, is a good one:



He left the gift that he had just bought in a friend's car.
He left the gift in a friend's car that he had just bought.



Since you can buy a car, and you can buy a gift, where you place the clause determines what it is that he bought. In the first sentence, he bought a gift; in the second sentence, he bought a car.


Now, both of these sentences are clear and have the same basic meaning:




A friend of mine at the University of Toronto, who is majoring in electrical engineering, received a government grant.
A friend of mine, who is majoring in electrical engineering at the University of Toronto, received a government grant.



The reason this works is that in effect you have two adjectival clauses, both modifying the antecedent. This is clear when you reword the sentence a bit:



A friend of mine, who is at the University of Toronto, and who is majoring in electrical engineering, received a government grant.



If you have two clauses modifying the same antecedent, either one can go first.


modal verbs - Is the epistemic "will have + past participle" construction compatible with "past adverb"?


I asked this question one year ago. Nico gave an excellent answer, but I still have some confusion.




A: We saw a police helicopter overhead yesterday morning.

B: Really? They would have been looking for those bank robbers.



As Nico mentioned in his comments, in the original context, only "would have been looking for.." applies, because the use of "we saw..." (simple past) implies that the search is also in the past and doesn't extend to the present (at least in BrE). Whereas "will have been looking for.." suggests the search extends to the present or is relevant at present.


Besides, he pointed out that in the OP's example, B isn't pretty sure, B isn't expressing certainty. Note that B starts the sentence with "Really?". B is expressing a belief. B believes that the police had been looking for those bank robbers.



I suspect "They will have been looking for those bank robbers" applies to the context as well.


My main argument is taken from F. R. Palmer's Modality and the English Modals:



Generally the modality is in the present only, because the judgments are made in the act of speaking, epistemic modals being in this sense usually 'performative'. The modal verbs are not normally used, therefore, in past tense forms to refer to past judgments. Past tense forms are normally tentative with present time reference. It is, of course, possible to report past judgments, but this requires verbs such as THINK, BELIEVE, etc.




Based on this, I think "They will have been looking for those bank robbers yesterday" is a grammatical sentence, meaning "I'm sure they were looking for those bank robbers yesterday". Is my understanding correct?


This use doesn't seem to be very productive. I got a couple examples from the Internet:



Countless hearts will have been blown open yesterday; both in Ireland, and wherever in the world literature is loved.


In terms of the GC Contador, Uran and Aru will have been relatively happy with their rides yesterday. Contador's team in fact led at the intermediate time check at 9.9km but lost ground - and their leader briefly - and had to settle for second place on the stage.



I don't know if they are standard English or regional variations. Even the present perfect can sometimes be used together with expressions of finished time, but we know that's not standard English.




Sunday, June 26, 2016

difference - "some " vs. "some of "



Some of rules can be the same for most websites.



vs.



Some rules can be the same for most websites.




I think I want to say



Some of these rules can be the same for most websites.




Answer



The word some goes in the central determiner position. Other words that can go in this position are:



  • a, the, my, no, any, either



We can only use one word in this position. If we want to use the words some, any either or numerals before another word in central determiner position, we can't. It's not grammatical:



  • *any the people (ungrammatical)

  • *some my friends (ungrammatical)

  • *either the glasses (ungrammatical)

  • *one my cats (ungrammatical)


In this situation we need to use any/some/either/one and the preposition of before the central determiner:



  • any of the people


  • some of my friends

  • either of the glasses

  • one of my cats


If there is no other word in central determiner position, we cannot use X of with a normal noun:



  • *any of people (ungrammatical)

  • *some of friends (ungrammatical)

  • *any of glasses (ungrammatical)

  • *one of cats (ungrammatical)



We just use the determiner on its own:



  • any people

  • some friends

  • any glasses

  • one cat


The original Poster's question:






  1. *Some of rules can be the same for most websites. (ungrammatical)




  2. Some rules can be the same for most websites.




  3. Some of these rules can be the same for most websites.






Sentence (1) is ungrammatical because there is no second determiner after the word of. Sentence (2) is grammatical, but it doesn't tell us which group of rules we are talking about. Sentence (3) is also grammatical. We know that the group of rules that can be the same is a subset of these rules. We don't know what these rules are without the context, but the sentence would be fine if we knew what the context was.


content generation - Can I run into legal issues with random names?


I'm currently building a game whose NPC's are going to be assigned a random gender and a random name for the right gender. To do this I will be using a "database" of names (actually a text file with tuples). There would also be a list of last names, which will be added to the first name also randomly.

My question is the following. Suppose one such random name is "George Bush", and this person has been randomly assigned the job of president. As you can see, this could easily be seen as having been "copied" from a real-life person.

The main issue is this. Names will be randomly-generated, yes, but the seed for random-number generation will be constant. In other words, the name of an NPC would be randomly-generated, i.e. I wouldn't choose it, but it would be the same for every player. Could this get me in trouble? We cannot verify all possible names, since the generated number of NPC's could be potentially limitless (new NPC's are being created whenever needed).



Answer



Legally I would be prepared for "change this name" notices and make it very easy to change that name; no matter how much in the right you think you are, it's just a nice thing to do.



Create and maintain a dictionary of names to avoid, no matter how legal it is anyone who sees "George Bush" in your game will immediately lose their sense of immersion.


Combined with a standard fictitious name disclaimer to cover obscure names you should be good to go.


grammaticality - Usage of a gerund and a verb in the present simple



Being sick, he, nevertheless, left home to go to work.


Getting sick, he, nevertheless, decided to come to work.



Are these sentences grammatical? Do they make sense? I am concerned about whether it is possible to start a sentence with a gerund and to use a verb in the past simple, like in my examples.



Answer



1: Don't use the commas around "nevertheless."



2: You need to start it with an "although" or similar.


3: I don't think you get to use a gerund with "nevertheless." Or at least not a gerund alone.


So: "Though he was sick, he nevertheless left home to go to work." "Although he was getting sick, he nevertheless decided to come to work."


Or: "He was sick, but nevertheless came to work to infect us all."


(If you use "Being sick," then you would have to use something logical for the condition of sickness -- you can't have "nevertheless." "Being sick, he called work to say he was staying home. Being considerate, he called out sick so he did not infect us all. Being sensible, we told him to stay home." The "nevertheless" indicates an unexpected, illogical, or contrary outcome. "Nevertheless, our boss called him back and told him to get to the office! Being upset about this, we all hope he coughs on the boss.")


Saturday, June 25, 2016

unity - Moving a dynamically spawned object


I would like to create an object dynamically when the player presses Q and use this object in Instantiate and in transform.Translate.


The problem is that the translation must be outside the if that checks for the Q press, but it applies to the cube that I created inside the if.


using System.Collections;
using System.Collections.Generic;

using UnityEngine;

public class instancier_new_object : MonoBehaviour {

public float moveSpeed=5f;

void Update () {
if (Input.GetKeyDown (KeyCode.Q)) {
GameObject objet = new GameObject ("objet");
GameObject cube = new GameObject ("cube");


cube = Instantiate(
objet,
new Vector3(1, 2, 3),
Quaternion.identity
);
}

cube.transform.Translate(
Time.deltaTime*moveSpeed,

0,
-Time.deltaTime*moveSpeed,
Space.Self
);
}
}


Active/Passive Voice Questions


This is something I heard in a party and would like to know the grammatically correct expression.




  1. If the bread has not reached you, raise your hands




  2. If the bread has not been reached you, raised your hands.





I think the second one is correct and is the correct passive form and the first one suggests that the bread itself was trying to reach you.




Friday, June 24, 2016

grammar - What is the difference between shall and may


Me and my brother were talking about a girl


So he said I shall be perfect for her.


Does shall mean the same as may?




javascript - How to optimize collisions


I'm building a 2D MORPG using JavaScript, Node JS and socket.io


To prevent cheating, I have to run all collisions for all players on my server.



I'm currently doing fairly simple square collisions like this:


  for (var i = 1 ; i < collidables.length ; i++) {
if (y < collidables[i].y + collidables[i].z &&
x < collidables[i].x + collidables[i].z &&
x + z > collidables[i].x &&
y + z > collidables[i].y) {
// Handle collision
}
}


When a player collides with a wall I halve their speed and bounce them back.
This is not working optimally, but it's fine for now.


The same logic is used to check bullet collision and possibly collision with monsters in the future.


I'm currently using 3 different loops for the follwing:



  1. Player vs Terrain collisions

  2. Bullet vs Terrain collisions

  3. Bullet vs Monster collisions


Since all of them have slightly different logic.



Should I put them all in the same loop or is using multiple loops fine? I feel like using multiple loops will slow down my server a lot once there will be some more terrain / players / monsters.


I chose square collisions because I think they are a lot faster than any other type of collision checking, and my game will have a LOT of collision checking.


I think I will allow between 50-100 players on a single server, with most likely hundreds of monsters and thousands of bullets flying around.


There will also be a rather big map that has to stay loaded on the server. But since the server doesn't actually have to draw anything this should be fine? Client-side the map is split up into smaller parts and only loads the parts near the player.


My game is working fine for now, but there's no real way to test with 50 players until people actually start playing.


I'm afraid I will find out way too late that my collision checking is taking up way too much server memory and/or cpu.


How can I improve the efficiency of my collision checks?


...


Here's a preview of my game in pre-alpha, it should make my question less abstract.


http://185.115.218.199:3000/



If I need to post any more info / code, please let me know and I will do so!


I'm currently running this game on a very small test-server with 512MB RAM and 1 VCPU (can't find the specifications)
This is scalable to up to 16GB RAM and 8 VCPU's and probably beyond that.




past tense - "My car was breakdown" / "My car had been breakdown"



Today I reached the office late.


My boss asked: "why you are late?"
I said: “My car had been breakdown near circle."
Then boss asked: "Then how you reached office"
I said: “I called the mechanic. He repaired the car. After repairing done I took the car and come to office"


I want to tell him my car had breakdown at 8:00 am and till 10:00am I had that problem till car was attained by mechanic my problem solved and reached home.


Should I use "had been" or is just "was" okay in my first answer? Is the above conversation correct? Specially my first answer. If not then how should this conversation be?




The meaning of "traveling grate" and "pallet car"


I am writing about an equipment which I just know its English name but not much its meaning (word by word), and I am trying to translate it


the word is Traveling grate (e.g by this company) in the page they call it as a process,



Our traveling grate process is the leading technology for producing pellets suitable for blast furnace and direct reduction.



while here they say




After surface ignition on the sintering machine’s travelling grate, air is induced through the ignited layer and the process continues in the vertical direction of the material bed.



Then I don't know its an equipment or a name for a process


There is also an equipment named Pallet Cars


I think I can guess their meaning but I am not sure about them (for example why Pallet, why Car! or why Grate, why Traveling).


Grate has many meaning, I guess grate here means a fireplace which is moving (However it also means a frame of metal bars and the equipment also consists of parallel grate bars)


The technology provide a chain (train or maybe it is called traveling grate) of Pallet Cars to move materials in sintering machine! they are like a pallet moving on rail (maybe because they have four wheel, they named it car), actually pallet has plates which grate bars are on it.


The following is an image of a pallet car consist of 4 plates consisting of parallel grate bars.


enter image description here





Thursday, June 23, 2016

physics - GameMaker: Studio - Slow down calculations


I currently have an orbital simulator, with a brilliant answer in another Game Development question here, and would like to know how to slow down the calculations of Game Maker, to be able to do more precise ones as my orbits suffer variably intense Apsidal Precession.


Examples of this can be found in games such as Kerbal Space Program and
Universe Sandbox 1/2. In KSP, you have the Max Physics Delta Time which allows slower gameplay, but more calculations. In Universe Sandbox you are able to change the accuracy of calculations causing orbits to go crazy and extremely precise.


How am I able to implement such a thing into GameMaker: Studio?




2d - Collision resolution in case of collision with multiple objects


I have static objects and movable objects. The collisions are detected using the separating-axis-theorem.


For example, in this situation I have two static objects (in red):


enter image description here


and a movable object between the two:



enter image description here


My algorithm is able to compute the collision between two of these objects, and it also spits out a perfect resolution vector (meaning a minimum-displacement-vector) to the collision.


So for example, when I check the collision between the green rectangle and the right red rectangle, the algorithm spits out a vector that tells me how I need to move the green rectangle in order to resolve the collision:


enter image description here


Notice that I just quickly drew this in MSPaint, so in that picture it could actually be that the minimum-translation-vector pushes the green rectangle out on the top, but I'm going to assume here that pushing it out to the left/right is actually shorter.


The general way of approaching this would be to only resolve the collision of one collision per frame, instead of all at once. But in my case, this would result in flip-flopping:


First, the solver detects two collisions but only resolves the collision between the right rectangle and the green rectangle:


enter image description here


Then, in the next frame, it detects only one collision which is between the left red rectangle and the green rectangle, and resolves it:


enter image description here



As you can see, this doesn't actually resolve the collision (for example by pushing the green rectangle out to the top), and instead just flip flops between the two states infinitely.


How can I solve this?



Answer



Depending on exactly what you are trying to achieve (high physical accuracy or just a close-enough real-time simulation), you could try using speculative contacts.


Here are the details: http://www.wildbunny.co.uk/blog/2011/03/25/speculative-contacts-an-continuous-collision-engine-approach-part-1/


He describes in that article what you need to know to implement it, and it's very simple compared to other approaches (such as sphere casting and then sorting collision resolutions by time of impact).


If you need/want more, you can purchase his source code for (IIRC) $7.


Here is a video of my implementation in 3D: http://www.youtube.com/watch?v=JvT2H1RmOas


Notice how stable the simulation is with just a single iteration. You could easily use multiple iterations per frame to resolve multiple collisions to a stable state, which would be more accurate.


c# - How do I show the ranking images at winning post?


I am working on a racing game in Unity3d and I have to show the rank as the winners touch the winning point.


As the winners reach at the winning point the image of the winner number should pop up for 1-2 seconds that is it.


How do I do it? Can anyone sort out this problem? Any help would be appreciated.


Thanks in advance :)




c# - How to solve the overlap of two circles that collide


I have two circles, one of the circles is static the other is moving around. I have a method that checks whether the two circles collide. How to make the two circles don't overlap when colliding?


public void UpdateGame()
{
//keyboard input and moving the circle here

if(CollisionDetection(dynamicCircle,staticCircle)
{
ResolveOverlap(dynamicCircle,staticCircle);
}

}

public class CircleBody
{
public Vector2 position {get;set;} // top left corner
public float CenterX;
public float CenterY;
public int Width { get; set; }
public int Height { get; set; }
}


public bool CollisionDetection(CircleBody body1, CircleBody body2)
{
float radius = body1.Radius + body2.Radius;
float distanceBetweenTwoCircles = ((body1.CenterX - body2.CenterX) *
(body1.CenterX - body2.CenterX)) +
((body1.CenterY - body2.CenterY) *
(body1.CenterY - body2.CenterY));

if(radius > Math.Sqrt(distanceBetweenTwoCircles))

{
return true;
}
return false;
}

public void ResolveOverlap(CircleBody body1, CircleBody body2)
{
//answer to my question
}


If it wasnt clear by now here is my code for solving that with two rectangles I want the same thing to happen to the circles.


public void ResolveOverlap(RectangleBody body1, RectangleBody body2)
{
double widthY = (0.5 * (body1.Width + body2.Width)) * (body1.CenterY - body2.CenterY);
double heightX = (0.5 * (body1.Height + body2.Height)) * (body1.CenterX - body2.CenterX);

if (widthY > heightX)
{
if (widthY > -heightX)

{
//collision - top
body1.Position.Y = body2.Position.Y + body2.Height;
}
else
{
//collision - right
body1.Position.X = body2.Position.X - body1.Width;
}
}

else
{
if (widthY > -heightX)
{
//collision - left
body1.Position.X = body2.Position.X + body2.Width;
}
else
{
// collision - bottom

body1.Position.Y = body2.Position.Y - body2.Height;
}
}
}


grammaticality - "God only knows" vs. "Only God knows"



One can say only God knows in reference to some mystery only an omniscient being would know, or for those who prefer their oaths minced, heaven knows or goodness knows or lord knows.


The inverted form God only knows is also very common. But if read in usual English word order, it means something different, that God knows to the exclusion of anything else— God "only knows," and doesn't see, hear, act, etc.


Why and how then do we say God only knows? Is it a mangled quotation, a holdover from archaic English, or something else?



Answer



"God only knows" is an idiom. These two are equivalent.



As to why James can't just give me a straight answer, God only knows!


I really don't know why James can't just give me a straight answer!



Where the phrase comes from, and why it is inverted is probably a better discussion for ELU.



From the perspective of an English learner, you're just going to have to accept that it's an idiom, and hence you'll have to learn it by rote.


Wednesday, June 22, 2016

difference - Having done something,... vs Doing something,


Do these two sentences mean the same thing? If not, please elaborate.





  • Growing up in California, I experienced life that was different than most people in Mexico.







  • Having grown up in California, I experienced life different than most people in Mexico.






Answer



The two sentences do not mean the same thing. The two phrases in the first sentence are happening at the same time, while the two in the second sentence happen in sequence - one after the other.




(While) growing up in California, I experienced...



The life that was experienced during the time that I was growing up in California was different from that in Mexico.



Having grown up in California, I experienced...



Because I grew up in California, my experience of later life was different from people who had grown up in Mexico.


The first sentence is a comment about the way of life for a growing person in California vs one in Mexico. The second sentence is a comment about the effect on one's point of view of the world from growing up in California vs growing up in Mexico.


Listening problem: "I'm going"


https://www.youtube.com/watch?v=cCXSO-3mt5I


In the above video 2016 State of the Union Address, at 2:10, according to the script, president Obama said "I’m going to try to make it a little shorter. ", but I cannnot hear " I'm going", is there a special pronunciation rule?




Spreadsheets in Game Design?


There have been two instances from the past two weeks that I've heard from well known successful game developers that they use spreadsheets when designing games.


The first being David Whatley in this GDCVault video: From Zero to Time Magazine: App Success


The second being the guys that do Walled Garden Weekly.



David said he models everything out and uses excel models to see how everything plays out. What on earth is he talking about? Is it seeing how the game mechanics react to each other?


Is there somewhere where I can learn more about how to do this?



Answer



To give an example where spreadsheets make sense for game balancing: I am currently developing an RPG. I wanted to design a formula for the experience needed to reach each character level. My goal was that each level takes a bit longer to reach than the previous one, even though the character is stronger with each level and thus makes more exp per minute.


So I created a spreadsheet with a row for each level and the columns "EXP to next" and "expected EXP per minute" which were a function of the level. The third row "minutes per level" was calculated from the previous two. That way I could easily see how much time the player will spend on each level with my exp per level formula.


My first formula used to calculate "EXP to next" in fact resulted in a decrease of the time spent on later levels, because I underestimated how much more exp high level characters will make. So I changed the formula from quadratic to exponential. That fixed it, but now the lower levels only took seconds. Adding a multiplication factor got nice numbers for the lower levels, but levels above 60 took several years to reach, which was rather overshooting my goal.


After a lot more fiddling around, I finally got a pretty nice formula which did what I wanted. Simulating all those formulas in a spreadsheet surely saved me weeks of playtesting.


Some random examples from other genres where using spreadsheets could makes sense:



  • Side-scrolling shoot-em-up: Average lifetime of each enemy ship when the player concentrates its firepower on it. Important to see how many new enemies per second are still manageable.


  • Real-time strategy: Simulating combat of each unit against every other one to see which one wins with how much health left. Check these results against the unit costs to get a hint which ones might be over- or underpriced.

  • 4X: Model economical growth over time and research progress over time to find a fair cost for each new unit/facility which becomes available.


animation - How do you deal with transitions in animating walking?


I'm pretty new to this whole animating models thing. Just learning the ropes. I got a nice walking animation going, which I can loop while a character is walking, but what about when they stop walking?


I mean, they could be at any point in the animation at the time the player stops walking. How do I get them to smoothly return to a standing still position without having them snap into that position? The same goes for starting walking from a standing still position. Do you need a separate animation? How is this dealt with?



Answer



You can have different levels of complexity depending on the degree of realism you want.




  1. Simply blend (= interpolate) from the walk to the stand animation when the character stops walking, and vice versa when the character starts.





  2. Let the walk animation rate depend on the character speed, this way the walk animation will slow down prior blending to the stand animation.




  3. Use transition animations: stand-to-walk is an easy one, just play it before your walk animation starts.




  4. Getting a walk-to-stand transition to work is a bit trickier, you'll have to know where your character is is his walk cycle, and wait for him to reach the transition point. And/or have several walk-to-stand animation that start at a different walk cycle point and trigger the right one when motion stops, probably with a bit of blending as well.





This goes on and on, you can consider using IK to snap feet to the floor, use human body physics for an even more realistic-looking motion, etc. This is really a question of artistic direction, and of how much time you can spend on this.


One thing for sure: if you want to experiment on all this easily, implement first a good data-driven animation system.


tense - The address is written on the back of the namecard



The address is written on the back of the namecard.


The address was written on the back of the namecard.




Do we use simple tense or past tense in sentences above?



Answer



Both sentences are grammatically correct. Whether you should use the present simple or the past simple depends upon the tense of the condition you want to refer to. If you want to refer to the matter in the present time, use the present simple. However, if you want to refer to the matter in the past, use the past simple.


xna - How to decompose sprite sheet


I have a lot of spritesheets that are poorly formatted that I want to decompose, or split out into many small images, one for each sprite. If I can do that, I can use my custom texture packer tool to build my game assets with.


My development tools are XNA and C# targetting Windows. How can I decompose the images?



Answer



Try Sprite Decomposer or Sprite Vortex, I believe both of them have automatic sprite cutting based on alpha.



xna - 2D platformer multiple rectangle collision cause jitter


I posted this question two weeks ago: 2D platformer corner collision and I implemented NoobsArePeople2's solution.


Problem is, when player intersects two rectangles that are inside each other, he starts jittering. I don't know how to describe it so I made a video: http://www.youtube.com/watch?v=2AYUGeuxM0c


In the first 4 or so seconds, you can see that when he collides with two rectangles that arent in each other or touching each other, everything works fine, but in the rest of the video, you can see that when player touches side, he starts to jitter (please note that because of fraps, my game was running at quarter of FPS I normaly have, so without fraps the jitter is much faster)


To give you idea how my collision rectangles look now, here is debug mode (each rectangle is randomly colored) enter image description here


I have couple of algortihms in place that merge rectangles into one (still need to do some work on that), but some simply cannot be merged. One example is the C object on the right. Right now it is made of 7 rectangles (will be 3 after I complete my algorithm) and when player slides on side of it, he starts to jitter.


I suspect problem is in my gravity, but Im not sure. I've spent 5 days on trying to fix this and Im lost.


Heres my code (slighty modified from platformer sample):



        for (int i = 0; i < playerCollisionRectangles.Count; i++)
{
Vector2 depth = Collision.GetIntersectionDepth(player.PlayerRectangleInWorld, playerCollisionRectangles[i]);
if (depth != Vector2.Zero)
{
float absDepthX = Math.Abs(depth.X);
float absDepthY = Math.Abs(depth.Y);

// Resolve the collision along the shallow axis.
if (absDepthY < absDepthX)

{
// Resolve the collision along the Y axis.
player.PlayerPositionY += Convert.ToInt32(depth.Y);
}
else
{
// Resolve the collision along the X axis.
player.PlayerPositionX += Convert.ToInt32(depth.X);
}
}

}

And here is my gravity code (very very simple):


        if (Gravity)
{
//for camera
position.Y += 2;
//position in world
playerPositionY += 2;
}


And lastly here is one of my methods to move player (i have similiar methods to move him left and up):


    public void MoveRight()
{
animate.Enabled = true;
animate.Row = 0;
position.X += speed;
playerPositionX += speed;
}

Answer




I think the problem is that when you are iterating through your collisions (playerCollisionRectangles) -- you are adjusting the position of your player more than once. This would explain the correct behavior when you are passing over single rectangles. When you are passing over more than one rectangle, the depth correction is being fired multiple times, causing jitter.


Tuesday, June 21, 2016

prepositions - It's been too hot the last / the past few days


Is it grammatically wrong to say



It's been too hot in the last / the past few days


It's been too hot for the last / the past few days





I saw this following sentence also, can we omit in it?




He's had two new cars in the last / in the past three years



as



He's had two new cars the last / in the past three years





Is there a strict rule in using of preposition or non-preposition when we use the last/past ?


What is the structure when I refer to weeks, months ?




Answer



Last week, month etc. is the week, month just before this one. The last week, month etc. is the period of X days up to the moment of speaking.



I was in Paris last week.


I have had a cold for the last week.


I have been busy for the last three weeks.



Sometimes the last means the last in a series. If you want to say that something happened during this period, you say that it happened in the last three weeks or during the last three weeks.



He had asked himself that question at least a thousand times in the last eight days.



Something funny happened in the last week of the holidays.



If you don't say the number, you can say



Many changes have been made in the last few years.



Or use recent instead. For example, you can say



Many changes have been made in recent years. Interest in golf has grown rapidly in recent years.




The past+ a noun is used to refer to the period up until now. ("their activities over the past two years").



During the past two weeks ten people have died of the desease. She has been feeling tired for the past three days.



The sources are Longman Exams Dictionary, M. Swan PEU, Collins COBUILD English Usage


I think it is clear that you should use prepositions in your sentences."For"(to say how long),during,in,over (something goes on within a period of time) would do.


filling the empty spaces in a certain region in a grid using c++


enter image description here


enter image description here Hi guys i am struggling to find the optimal way to fill the grid of a certain region.


In the above example lets say my player is at (7,5) and traveled (2,0) and i have the information of all the points he went through. for example: (7,5)->(6,5)->(4,5)->(4,4)->(4,3)->(3,3)->(2,3)....(2,0).


Here what i want to do is fill in either top side of the path with some color and bottom path with some other color.


and same goes for the other cases as well if player travels from (7,3)->(5,0) i want to color the insides with one color and out sides with another.


can any body explain me the logic to do this in c++ please thank you.


i went through that flood filling but not sure how to implement that for this one :( .





Definite article "the" introducing the subject of a sentence


In a tutorial on Qt Quick I have the following line in a paragraph describing the main screen:


ItemDelegate wrapper contains all fields on the main screen and the detail screen.


My question is: is this correct ? Or do I need to put "The" before ItemDelegate.




Answer



In your example sentence, the missing article makes it reads like headlinese.




In headlinese, used in the construction of headlines, sentences are constructed without articles or other elements in order to reduce their space. (Or at least that's how the practice started.) This is often accompanied by changing verbs into the present tense.


For example:



A man jumped from a building yesterday. (Regular sentence.)
Man jumps from building. (Newspaper headline.)






If you want your sentence to read more naturally, you can make the subject plural, add an article, or even (although this would be non-standard) use a possessive:



ItemDelegate wrappers contain all fields on the main screen and the detail screen.
The ItemDelegate wrapper contains all fields on the main screen and the detail screen.
An ItemDelegate wrapper contains all fields on the main screen and the detail screen.
ItemDelegate's wrapper contains all fields on the main screen and the detail screen.



Which version you choose would depend on the context and your own preference.




As a note, all fields is an elliptical version of all of the fields and could be considered a minor form of headlinese itself.



To avoid that entirely (it's purely a matter of style), something like the following could be used instead:



ItemDelegate wrappers contain all of the main screen and detail screen fields.



unity - How does Unity3D lower an imported .obj vertex count?


I have a question regarding how Unity3D handles importing of .obj files. I'm importing this teapot: http://groups.csail.mit.edu/graphics/classes/6.837/F03/models/teapot.obj


The number of vertices this teapot has is 3644. I know that Unity's Mesh class needs to replicate these vertices for each face shared by the same vertex. I tried this with a Cube imported from a .obj, and using Debug.Log() to print the number of vertexes I found out that there were 24 vertices in the mesh's vertex array.


However, with the teapot the original file had 3644 vertices, so in Unity the vertex count should be 18960. Instead, when I print the length of the mesh's vertex array, it prints 3260 (even less than the original file).


The final objective for this is that I'm trying to modify an OBJ Importer script from Unity's Wiki, so that the number of vertices resulting from this script are the same as Unity's native importer. Reference: http://wiki.unity3d.com/index.php?title=ObjImporter Note: I printed the vertex count using this importer and the result was 18960.


Does anyone have an idea of how this vertex reduction might be achieved?



Answer



There are several factors that contribute to how the geometry is saved and processed in different mediums (programs, file formats, APIs). I did implement several commercial geometry analysis programs, so I have some experience with it.



First I am sure this has nothing to do with Unity simplifying anything. But in case it did there are several decimation algorithms that can be implemented but I am sure this isn't the case, since a game engine isn't supposed to change the shape (geometrical properties of a mesh) but can usually modify its connectivity to match his optimal structure.


Some of these factors are:


What makes a vertex unique?


This can greatly vary depending on how the program, api or file format deals with a vertex. A vertex can be unique if it has a unique position, but in other cases it's unique if it has any unique attribute. For example if two vertices share the same position, but have different normals they should be "duplicated" in case of OpenGL, this is especially evident in the case of the cube you mentioned.


enter image description here Hard vs Smooth edges.


Normals can dictate if an edge is considered hard or smooth, if a vertex contributes to hard edge, then it needs to be duplicate so the current rendering APIs can understand how to render(shade) this face correctly.


enter image description here


Indices


Many file formats permit a face vertex to have several indices for the vertex position/texCoords/normals, this isn't the case of current rendering APIs. A fine example of this is the Obj file, this will force Unity to rebuild the indices and often duplicate many attributes to match the vertex indices.


Connectivity



A lot of the vertices that are actually connected and are unique are saved multiple times, this has to do of how the original file writer processed and saved the mesh. Unity will reduce the number of duplicate vertices (remember if it has different attribute then it's not unique) so to make it more efficient for storage and processing without sacrificing the quality.


This has also to do of how many polygon sides the original file permits, Obj for instance permit N-side polygons, which something any sane game engine doesn't want, so it end up triangulating the mesh and recalculting many of its attributes which often change the number of vertices.


usage - More than 9 hundred as hundreds?


In German, we often use "Elfhundert" (literally, "eleven hundred") for 1100 or "neunzehnhundert" ("nineteen hundred") for 1900; but is this correct in English?



Answer




Yes, people normally say


fifteen hundred instead of one thousand five hundred


and


nineteen ninety nine instead of one thousand nine hundred ninety nine


However, I hear a lot of people saying


two thousand fourteen instead of twenty fourteen


Probably because twenty fourteen just doesn't flow off the tongue as nicely as years back in the nineteen nineties


Monday, June 20, 2016

meaning in context - What does "resp." mean in these sentences?


The abbreviation resp. has been used a number of times in the following paragraph:




For each of these problems (resp., tools), we start by presenting the natural concern underlying it (resp., its intuitive objective), then define the problem (resp., tool), and finally demonstrate that the problem can be solved (resp., the tool can be constructed).



I am trying to understand what resp. means here (and many more times in the same book).


Trying to search using Google only confused me more, there are so many options.


Also please see this answer, which says that "resp." means "namely". Is this correct?



Answer



I suspect this is a mistranslation of German bzw. = beziehungsweise, which can mean either respectively or or as the case may be. The translator has taken a passage in which the latter sense is intended and substituted the conventional abbreviation of the former sense.


The latter sense has no convenient one-word English translation, much less an abbreviation. I have often regretted this, because bzw. is so useful.


It sort of works, but not so gracefully, if you just substitute or for resp.




For each of these problems (or tools), we start by presenting the natural concern underlying it (or its intuitive objective), then define the problem (or tool), and finally demonstrate that the problem can be solved (or the tool can be constructed).



difference - Present perfect continuous


I’ve been thinking about the subtle differences in these three sentences



1-I’ve been reading books for years

2-I’ve been reading a lot of books for years
3-I’ve been reading five books for years



From what I understand


The first sentence is the most common one and it means that I’ve read books and I still read books. Basically you finish one and move to the next.


The second isn’t common and it can also mean that , say lot is 100 books So you’ve been reading 100 books together and you still haven’t finished any of them? Or I’ve just finished all of them


The last one means that I’ve been reading five books and still haven’t finished them Or I’ve just finished all of them


Is my understanding correct here? My brain hurts after thinking of all of those interpretations.




infinitive vs gerund - What is the difference between 'want camping' and 'I want to camp'?


I want to learn the difference between 'I want camping' and 'I want to camp'. Please, somebody tell me the difference~




Sunday, June 19, 2016

active voice - When can I use "having + past participle"?


I wonder whenever should we use



Having + past participle



Instead of




Verb + ing



Whereas its more common to use verb + ing instead of having + past participle. For example :


Having finished our work, we went home.


What's difference with following sentence:


After finishing our work, we went home.


Whether it is more formal or something else. Would you mind somebody explain this grammar?




I have questions about future real conditional and future unreal conditional


There are a couple of sentences that I usually get mixed up.





  1. If you try to take pictures of restricted exhibitions, a member of the staff will ask you to put your camera away.

  2. If you are caught with food or drink inside the museum, you will be asked to dispose of it immediately.

  3. If a person eats healthy foods like fruits and vegetables, It is more likely that they will be healthy.

  4. It would be great if you could learn something every time you went to a museum.



I understand future real conditional and future unreal conditional like followings.


Future real conditional can be used in a situation where something is more likely to happen.


Future unreal conditional can be used when I'd just like to imagine and guess what it would be like if something happened or in a situation where something is impossible to happen.


And important thing is that it seems like I can use either of them in some situation because Future unreal conditional can also be used in imaginary situation.





  1. If you tried to take pictures of restricted exhibitions, a member of the staff would ask you to put your camera away.

  2. If you were caught with food or drink inside the museum, you would be asked to dispose of it immediately.

  3. If a person ate healthy foods like fruits and vegetables, It would be more likely that they would be healthy.

  4. It will be great if you can learn something every time you go to a museum.



So, can I use both of them in these 3 sentences?




word usage - How to tell a child that he is not right or that he did something wrong


When my little son is doing (did) something and I want to praise him or tell him that he is doing (did) it right I can use the following phrases:



  • that(it) is right(correct)!

  • you are doing well!


  • that is the way!

  • way to go!

  • well done!

  • success is yours!


But the question is what phrases are opposite of these. What do you think about following phrases?



  • that(it) is wrong

  • that(it) is not right

  • that(it) is incorrect


  • that(it) is not correct

  • you are(were) wrong

  • you are doing (you did) wrong

  • you are not doing (you did not) well

  • that is not the way

  • you are(were) mistaken


Please let me know which of these phrases are incorrect, correct or correct but uncommon. And give me your common versions. Thanks!



Answer



All of these sentences are correct and appropriate, with three exceptions:




  • "You are doing wrong" should be changed to "You are doing it wrong" or "You are doing a bad thing" or "You are making a mistake".

  • "You did wrong" should be changed to "You are wrong" or "You did something wrong" or "You made a mistake".

  • "You did not well" should be changed to "You did not do well".


Even these three exceptions are sometimes said by native speakers, but these exceptions are not quite Standard English.


"Uh-oh" is another option that means either "Something is going wrong" or "Something just went wrong".


Homer Simpson exclaims "Doh!" when he realizes that he made a stupid mistake.


Saturday, June 18, 2016

Some questions about Inversion sentences


enter image description here


Source: https://www.perfect-english-grammar.com/inversion.html


I found this, and it says "We only use inversion when the adverb modifies the whole phrase and not when it modifies the noun."


What does modifies the whole phase mean?


Take the two sentences below for example:





Not until I saw John with my own eyes did I really believe he was safe.




The word "Not" modifies the phase "until I saw John with my own eyes", right?




Only when we had our lunch would we go to work.





The word "Only" modifies the phase "when we had our lunch", right?


What about sentences like below? Is inversion required? Inversion is required only when adverbs like "only", "never", "not".... modify the whole phase, so sentences like below are not the case, right?




When he only eats chips, he gets fat.


When I only do simple things, I can concentrate.


When a man only thinks of himself, he loses his friends.






Answer



The words triggering inversion in these cases are not the adjectives themselves, per se, but the negative-polarity words "only" and "not" with the adverbs. If you removed them from any one of the sentences inversion is no longer used:


Until I saw John with my own eyes I believed he was safe.


Since Lucy left college she has had so much fun.


After I'd seen her flat I understood why she wanted to live there.


When we'd all arrived home I felt calm.


By working extremely hard we could afford to eat.


So no, the adverb itself modifying the entire phrase doesn't trigger inversion, the presence of certain negative-polarity adverbs with the main adverb is what triggers the inversion. Other more obviously negative adverbs do this as well: "never", "nowhere", "neither", "nor", etc. All these also trigger inversion when they sit right next to the main verb in their more normal positions as well: Never have I seen..., Nor did he go..., Only with great trepidation did she....


Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...