Jump to content
  • Advertisement

Search the Community

Showing results for tags 'OpenGL'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 1000 results

  1. well rutin has helped with this problem, but I wanted to get more input. I am still working on my rotation algorithm. I want my bullet sprite to rotate around my plane sprite and shoot in the same direction as my plane is facing. glTexCoord3f(0.0f, 0.0f, 0.0f); glVertex3f(cos(angle) - sin(angle), sin(angle) + cos(angle), 0.0f); glTexCoord3f(1.0f, 0.0f, 0.0f); glVertex3f(cos(angle) - sin(angle), sin(angle) + cos(angle), 0.0f); glTexCoord3f(1.0f, 1.0f, 0.0f); glVertex3f(cos(angle) - sin(angle), sin(angle) + cos(angle), 0.0f); glTexCoord3f(0.0f, 1.0f, 0.0f); glVertex3f(cos(angle) - sin(angle), sin(angle) + cos(angle), 0.0f); glEnd(); here is the code I am using.
  2. Zemlaynin

    Devblog #1

    Concept Document Game project, a global strategy simulator of civilization development - The Great Tribes 1. Classification Genre: global strategy, simulator. Time of one walkthrough: 10 + hours. Platform: PC. 2. Main Features The Great Tribes is a global strategy simulator of civilization development, the action of which takes place in the historical period from 3000 BC to the beginning of 3000 AD. During the game the player will have to create their own unique civilization and try their hand at its development in a nonlinear, constantly changing world. Conceptually, the game is a cross between a turn-based strategy Sid Meier’s Civilization VI and strategies of Paradox Interactive (Crusaders, Europe and Victoria). Similarity with these games is limited to the time period covered in the game and some game mechanics. In our project we want to reflect the role of a personality in history, but instead of personalities history is influenced by different factions. We focus on working out in detail of various historical phenomena. We are planning to create an advanced economic system that will make it possible to simulate economic processes with a high degree of realism. The simulation of interaction between different countries includes: diplomatic relations, economic, technological, cultural and social influence. The conduct of military actions between the countries in our project will be realized in a wide range, from single collisions to waging a trench warfare at a vast front. Realistic simulation of the historical process The game model is based on the results of the latest research in various scientific fields: from history and political science to geology and agricultural sciences. Simulation allows to simulate all the significant historical phenomena and processes. Flexible Turn-based Gameplay System The calculation of the game turn is divided into a turn and a tick. The turn calculates global parameters: population and economy growth, migration of strata and changes in their characteristics, etc. During the game it is possible to change the time step depending on the player's preferences. Ticks only occur in combat. There are 4 ticks in the course of the turn: spring, summer, autumn and winter. Thus, the army that committed a long march-throw and entered the battle running out of action points will fight in the winter tick with the corresponding consequences. Advanced Technology System Technological discoveries occur randomly, and the probability depends on the accumulation of a corresponding number of technological points: agricultural, industrial, military or social. After the discovery, the technology is embedded into one or another technology package, which has an impact on a particular game system. Mechanics of technological packages allows to make development in the game realistic and not always predictable. Two-dimensional Social System The population in the game is grouped into strata and factions. Strata determines the place of the household in the labour division while the factions are responsible for the redistribution of power in the game. For example, the insufficient number of strata workers could hamper industrialization of the country and the trade union faction can fight for the rights of this small strata. Flexible Coalition System The coalition system allows to create various forms of relations between administrative units: an administrative zone and a region, a region and a country, between several countries (confederations, vassal relations, unions, etc.), between a region and an army (government armies, feudal armies, etc.). Realistic Economic System Economy in the game is a system based on the dynamic cost of resources, goods and services. This makes it possible to simulate a variety of regional specializations, economic imbalances, etc. Unique Political System The main elements of the political system in the game are the form of government, political values, laws and corruption. The form of government is based on the ratio of five elements: barbarism, community, democracy, oligarchy and monarchy. Changing the ratio of these elements, it is possible to simulate any existing or even a non-existent form of government. Political values reflect the position of the elite on each of the political or parapolitical issues. During the game the elite (of its own free will or under the pressure of the player) can change their values, but, as a rule, it is painful and not fast. Laws allow to carry out quite a fine adjustment of the country, and corruption can help to restrain the player from excessive expansion of their power. Diversity of Cultural and Civilization Forms Unlike other games, civilizations in the game are formed on the basis of 4 pairs of framework principles, which can form up to 16 unique civilizations, and their combination allows to generate up to 3520 unique cultures. Conduct of Military Operations The military aspect of the game focuses on the strategic management of armies: formation of military doctrines, establishment of the conduct strategy of armies, determination of the optimum correlation of branches of armed forces for this or that army, etc. The player will be able to concentrate on planning the strategy of the military campaign. 3. Gameplay The main task of the player is to develop their country in conditions of external threat and/or internal instability. By controlling a multitude of mechanisms, the player can implement any of the goals offered in the game: creation of the richest trading empire, holding power in the role of one ruling dynasty as long as possible, being the first to implement the industrial revolution, etc. 4. Game Map The game map is divided into tiles and subtiles. But this division is valid for the technical side of the game. In terms of gameplay, the map is divided into tiles only. Each tile occupies an area of 1369 sq. km (this value may change during balancing). Within this area on a tile there can be located districts (in the cities), buildings (outside the settlements), the tile can be divided into different types of biomes, etc. Depending on the biome, a certain amount of resources may be situated on the tile. So, it is advantageous to place fields on meadow plains, the area of which depends on the area of agricultural lands of the tile. In addition, each tile has a certain level of transport infrastructure, which defines the movement speed of armies and the capacity of trade caravans. However, unlike armies, caravans can move only along the main routes which are indicated on the map. This path can change its trajectory, depending on the quality of transport infrastructure of neighboring tiles, crime rates and other factors. The closer is the tile to the crime center (the settlement of the player or another country or a bandit/pirate settlement), the higher is its crime rate. On the map there constantly appear bandit armies, so they are exactly simulated by this parameter, only without the need to constantly drive armies across the country to destroy them. Rebel armies will be represented in the form of full armies. In addition to the transport infrastructure, there is a parameter of urban infrastructure. The urban infrastructure represents the level of development of various services and engineering networks of the settlement (accessibility and quality of utilities, communication facilities, urban transport, catering, retail, emergency services, etc.). Urban infrastructure is available not only in cities but also in villages. To create favorable conditions in the settlements the player will have to balance between the development of transport and urban infrastructure. 5. Administrative division and types of settlements The game has three levels of control: a country, region and administrative zone. An administrative zone is a territory with dynamic boundaries, being controlled by the settlement. Within this territory, residents of the settlement can build anything within the framework of the ongoing development programme. All types of settlements without exception have this zone, from villages to cities. If a city in the region forms a new region, all the tiles in its administrative zone also become part of the new region. Administrative zones are grouped into a larger formation – a region. A region is a territory with dynamic boundaries, consisting of a certain number of administrative zones. It necessarily includes the capital city of the region. Unlike the administrative zone, a region can simultaneously be a country (consisting of one region). In addition, the player can directly manage it (whereas administrative zones can be managed only through legislation). A country is the highest level of control in the game (not counting international coalitions), representing one region or a coalition of regions. A coalition means not the country's federal structure, but the system which defines relations between different administrative units in the game. Each country has a capital, and as a consequence - the capital region. The region of this type has the same functionality as a usual region, but in addition it hosts the highest state bodies: ministeries and the advisory board. Each level of management has its own central settlement. It can be a village (only for the administrative zone), city or encampment. A village is a type of settlement focused on food production or resource extraction. Over time a village can be upgraded into a city. The game presents 3 basic types of villages: agricultural, resource-extracting and military. An agricultural village is oriented to the processing of farmland. A resource-extracting village is focused on the extraction of minerals. The type of resources that are extracted depends on the demand for the resource. A military village generalizes a variety of villages, the inhabitants of which are hostile to the player. A rebel village: village troops will defend their village and their independence. A village becomes rebellious if the population's loyalty to power is too low. A bandit (pirates) village: village troops will attack the settlements and trade routes located nearby. A village prefers to move into this state due to absence of legal means to maintain an acceptable standard of living. The given types of villages are conventional. All villages have the same characteristics, but their chosen vector of development depends on the demand for a particular resource, or on the level of loyalty to power. New villages in the game can be formed either automatically or due to a certain decision. The place of automatic appearance of villages is determined on the basis of attractiveness of adjoining territories for processing, and also is located at a certain distance from other settlements and processed tiles. As the population of old settlements rises to some level, the chance of a new village emerging at some distance increases. Its population will not appear out of nowhere, but it migrates from the settlement. New villages can occur both inside and outside the region. Encampment is a type of settlement of nomadic cultures, able to move to other tiles. Settling, nomads form a village or city (depending on the size of the nomadic group). Unlike a city, playing for encampment is concentrated not so much on the management of the population, but on the management of tribal clans (factions). Each clan has its own encampment. The elite of each nomadic group includes every member of the clan. However, the encampment can include residents who are not part of the clan (slaves, mercenaries, etc.). The more solid (controlled) the clans are, the stronger the tribe is in clashes with other nations. This clan structure of the society is typical of all countries with barbaric elements of government. However, in settled states clans do not always act as the elite of the settlement. In addition, unlike cities, change of dominant elites in the tribe occurs not gradually through transfer of population from one faction to another, but via change of the fraction status. In game mechanics it is represented in the form of change of the capital nomads and status of the elite. Another distinguishing feature of nomads is their ability to move around the map. This is possible in two ways: moving the nomadic population of the ruling clan, while the rest of the nomads are moved in automatic mode (due to an insufficient level of control or by the decision of the player); moving all the nomads manually with a sufficient level of control. Poorly controlled nomads are moved in automatic mode. A city is a type of settlement with multiple forms of activity, but with a certain specialization. A city is not necessarily a result of the village development, but it can be built from scratch, or formed from the outpost (see Regional buildings). Unlike a village or encampment, a city that is the capital of a region or country can have up to three Wonders of the world (one of each level: regional, national and international). In the game there are many specializations of cities: Administrative center Science center Trade center Cultural center Religious center Industrial city The higher the city is placed in the hierarchy (a provincial city - the capital of the region - the capital of the country), the greater effect its specialization produces. So, if the player decided to build a huge empire, it is better to establish an administrative center as the capital (for the control of large territories), for a trading empire it should be a trade center, and for theocracy it is more preferable to assign a religious center of a state religion, etc. The difference between a city and a village: a city has a more developed social infrastructure; it occupies a certain area of the tile and when it is exceeded, it expands to a neighboring tile; a city creates an administrative load; it is possible to construct wonders of the world (in capitals); it has diverse stratification and division into districts. 6. Urban districts In the city, a player can build up to seven districts that can be expanded to accommodate various infrastructures: An administrative district performs functions of control and development of the administrative resource; An industrial district produces practically all types of goods (except luxury); A cultural district produces luxury goods, prestige, and also creates some modifiers for the city; A scientific district is responsible for increasing literacy of the population and accelerating the development of technologies; A religious district - the development of the district contributes to increasing the influence of state religion; A commercial district – transport and financial infrastructure is created here; A social district provides the population with housing and urban infrastructure. Six of the listed districts can be built in the city center and determine its specifics. In addition, the effect of all districts depends on the location of the city – it can be situated near the shore or in the depths of the continent. Characteristics of districts Cost includes resources needed for the region expansion. Content includes resources necessary for supply of the district during each turn. Workforce is the number of working hands required for the efficient operation of the district. Area is the area given and available for expansion. Effect stands for the bonus-malus payments, received in the course of functioning of the district. Wonders of the World Instead of usual constructions three types of wonders of the world are built in cities: regional, national and global. The effect of every kind of wonders is spread according to their scale. The list of wonders available for construction in the city depends on the central district of the city. And the effect produced by the district will be determined by the chosen wonder. In addition, the district can include up to three wonders, one of each level.However, construction of a higher-level wonder reduces the effect of wonders of a lower level. The wonder effect can also be reduced by the presence of a similar wonder in the zone of influence and visibility. The scale of the wonder influences its price and effect. In addition, the effect of a small wonder can easily disappear if certain conditions are not fulfilled, whereas the effect of a world wonder never disappears. 7. Regional buildings In addition to the wonders of the world and urban districts, the player can also build constructions outside the city - in regional and extraregional tiles. Characteristics of regional buildings: Cost stands for resources necessary for construction. Supply includes resources necessary for ensuring the construction during each turn. Workforce is the number of working hands required for an efficient operation of a building. Location defines whether it is possible to build a construction only within the district or everywhere. Improvement - some buildings can be rebuilt into other more significant constructions. For example, a wooden advance outpost can be upgraded into a stone one. Accommodation conditions - most buildings can be built only in tiles with certain conditions. Effect - buildings can produce a variety of effects: from ordinary bonuses to the ability to extract resources and supply armies. List of buildings Agricultural: gardens, a pasture, a field, a camp; Mining: a quarry, a sawmill, a mine, a drilling rig; Military: an outpost, a military base. Unlike other buildings, outposts can be installed outside the district. The outpost has its own control zone, which complicates the speed of enemy forces passing through it, and decreases the level of crime in the district. In addition, outposts with a sufficiently high level of development of urban infrastructure can be converted into a city or village. 8. Domestic Policy The key indicators of domestic policy are the administrative burden and the administrative resource. The administrative burden is the level of constant administrative spendings on the management of the country, as well as various actions of the player. The administrative burden of the country is the burden of the regions and the highest governmental structures. The administrative resource is the management resource which represents the number of civil cervants and their management efficiency. If the administrative load exceeds the administrative resource, the player begins to lose control over the regions. In addition, the administrative resource can be spent on corrupt practices. Corruption in the game is trade in administrative resource, carried out by the management apparatus. Like for any resource, the laws of supply and demand apply to the administrative resource. Strata that captured part of the administrative resource of the city, region or country get the opportunity to determine the actions of a chosen government institution. In addition to trade in the administrative resource, corruption is expressed in the form of an indicator of the region or government structures which determines the efficiency of budget spendings on their needs. Forms of Government Another important element of domestic policy is the form of government. It is a mixture of five elements: barbarism, community, democracy, oligarchy and monarchy. Each element can take a value from 0 to 10, where 0 is the absence of characteristics and 10 is its pure, pronounced characteristics. For example, a country may have the following form of government: barbarism (5), community (3) and oligarchy (2). Total expressiveness of all forms of government should be equal to 10, so to increase an element, for example, democracy one must reduce the strength of one of the remaining elements. Each of the elements of the form of government gives its own unique effect and when changing the form of rule the gameplay changes accordingly. Forms of government also give access to 1) certain social technologies. Some of the technologies are closed from some forms of government. For example, rooted barbarism closes access to tax collection and trade technologies. 2) to the laws For example, a strong monarchy gives an opportunity to pass a law on inheritance of power. Political values Political values reflect the standpoint of the strata and factions on each of the political or parapolitical issues. In the course of the game they (of their own will or under the player’s pressure) can change their values, but, as a rule, it is painful and not fast. The game has the following groups of values: Economy: a hard plan \ a soft plan \ pragmatism \ a regulated market \ a free market Openness of the society: closed \ moderately closed \ semi \ moderately open \ open Social Policy: state / state-society / society / society - individual \ individual Foreign Policy: isolationism \ non-interference\ realism \ interventionism \ expansionism Religious Policy: theocracy \ clericalism \ secularism \ anticlericalism \ militant atheism National Policy: nazism \ nationalism \ multiculturalism \ internationalism \ cospomolitism Post-values: denied \ invalid \ neutral \ minor \ important Post-values in the game reflect the attitude of people to the values of new, upcoming phases of development. For example, in the course of society's transition to the industrial phase of development, issues of emancipation of women, ecology and others became significant. The more loyal the society is to post-values, the more inclined it is to revise its other values, which can lead to social instability. The forms of government along with the political values of the elite allow to simulate all the basic forms of political formations. Laws If the forms of government tell us who rules the country, then the laws show how the country is ruled. Laws can be adopted both for the whole country and for each region separately. The adoption of any law entails a temporary decrease in the loyalty of regions. Besides, the laws are not just effects, but also constant expenses on their maintenance. The lack of resources for the maintenance of laws leads to the fact that laws cease to operate, starting from the recently introduced and ending with the most entrenched. Forms of struggle for power Finally, the domestic policy is expressed in the struggle for power. Depending on the prevailing contradictions between the authorities and the opposition, the latter may make various steps to change the current power: Change of the party of power (occurs in the form of cabinet struggle within the established norms) Civil disobedience Insurrection / Coup d'état Terrorism Civil war Guerrilla war Participants of the guerilla movement are the strata with the state religion and culture Peasant War The lower the position on the list is, the higher is the massiveness, the number of victims and the cruelty of speeches; the current rules and regulations are followed less and the speed of the process is higher, but, in case of success of the action, reforms conducted by the new power are more radical. 9. Foreign Policy Diplomacy and Prestige The basis of diplomatic relations in the game is the system of coalitions. Coalition agreements can be concluded between countries, between regions and even between the capital of the region and the settlements belonging to it. In fact, it is a universal pattern of establishing communication between administrative entities. The main resource of diplomacy is prestige. Prestige is a generalized measure of grandeur of an international organization, country, region or settlement. This parameter affects both the other administrative entities and the perception of any entity by the population. So, a city, producing a lot of prestige, can get a good income from tourism. And a country with high prestige can tempt other countries and regions over to its side. Espionage Espionage in the game is an agent network that is introduced into a particular region. The more developed the agent network is, the higher the chance of success of espionage actions or counteraction of foreign secret services is. 10. Demographics The population in the game is divided into strata and factions. Strata reflect the professional role of the population in the game, whereas the role of factions is to fight for power in any of its manifestations. Strata The game presents the following strata: Peasants Workers Slaves Specialists Merchants Clergy Aristocracy Civil servants Soldiers From the very beginning the game presents only part of the strata. The rest get available as technology evolves. Strata parameters Values are the views of a strata on the best government policy. Openness is the level of difficulty in entering and leaving the strata. The degree of attractiveness is an indicator that reflects the extent to which people seek to change their social and professional status and become part of this strata. In working strata (peasants, workers, specialists) attractiveness depends on the level of their income and unemployment in the industry where they work. The attractiveness of civil servants depends on the state demand for them. The attraction of slaves always equals 25%. The attractiveness of the other strata depends only on income. The minimum attractiveness is 10%, the maximum is 500%. In addition, the attractiveness of a strata is influenced by its rights, consumption level, entry into the elite and dominant values in the society. Size - the growth of the size of a strata depends on natural population growth and the entry/leaving of people to other strata. In addition, the size of a strata can change the losses in the war and during repressions. Fertility falls with the increase of consciousness of the population and when achieving a high standard of living. It is growing with the development of healthcare. Mortality falls when the population's living standards rise, as well as with the development of healthcare. Consumption level reflects the categories of goods that strata needs. These products are divided into three categories: necessities, everyday and luxury items. If a resident has no money for essential goods, or if these goods are not on the market, he is threatened with death.The level of happiness depends on the satisfaction of everyday needs, as well as on the consumption of luxury goods. The ability to buy luxury items is a factor of transition to more attractive strata, while lack of access to essential goods and luxuries contributes to the transition to less prestigious strata. Income depends on the wage rate, or on income from enterprises. Expenditure is expenditure on consumption, as well as contributions to the funds of the factions. Wealth is all the accumulated property of a strata. Wealth increases due to the fact that strata keep part of their income. Wealth decreases with high crime level in the settlement or its looting, growing in the course of accumulation and investment activity. Unemployment exists only in working strata. Crime is the proportion of strata involved into criminal activity. Consciousness is the level of political culture and simply civic consciousness of the population. The loyalty to the authorities reflects the level of support or opposition to the ruling regime. It can take values from -5 to + 5. Civil, political and social rights are set by political decisions. Literacy reflects the level of theoretical knowledge of strata in its professional sphere and the degree of its qualification. Culture stands for belonging of a strata to a certain culture. Religion is belonging of a strata to a certain religion. Migration of the population Migration occurs between settlements if they are connected by roads. People will migrate between the settlements of the region, from one region to another, if there is a shortage of working force, the prestige of the settlement and the living standards of the population are higher etc. The quality of the road network determines the volumes of migratory flows. Factions In addition to strata, the game includes factions (groups of interests) that represent the force that can influence the political situation in the country. Examples of factions: Ruling Dynasty/Royal Court/Government Aristocratic/Oligarchic/Mafia clans Parties/Revolutionary groups/Separatists/Terrorists/Ideological groups Religious orders/Sects/Schools of Great people Metropolitan and Regional Elite Faction parameters Size stands for the number of supporters of the faction. Goals/values are goals and/or values that determine the direction and nature of the faction's activities. Openness is the level of difficulty of entering the faction. Prestige reflects the attractiveness of the faction among the other factions, as well as the degree of influence. Wealth is a foundation which deductions are made into by members of the faction and other factions/organizations. Income/Expenses Radicalism is readiness of the faction to illegal actions. Rights stand for the level of political rights of the faction. Cohesion is the level of strength of the faction and the ability of its members to act as a whole. Breadth of views consists in the hope of increasing the number of its supporters. The faction can expand the scope of its value views, but this makes it lose cohesion and weight of each faction member in its cumulative effect. 11. Culture and religion Culture is ethnic affiliation of the peoples inhabiting the country. It is based on a combination of 4 pairs of framework principles: Time-Space Individual-Mass Rational-Transcendental Spiritual – Material The combination of these principles allows to create 16 unique civilizations. Civilizations are not a homogeneous mass, but a collection of many heterogeneous cultures whose values are conditioned by civilizational principles. Cultural values, in fact, represent the imposition of civilization principles on each other. All in all in this way each civilization can form up to 220 unique cultures (i.e. in total in the game there can be up to 3520 unique cultures and 16 civilizations). The civilizational principles also define the peculiarities of religions of certain civilizations. Cultural assimilation The player is allowed to carry out cultural assimilation of villages and cities into the state culture at the cost of reducing control over them. The process of cultural assimilation takes dozens of turns. Players can also change their state culture. This process takes several turns. In the course of changing the state culture, control over those villages and cities that have a former state culture falls sharply. Religion If the value aspect of religions depends on the place of their origin, their organizational type is determined by the player. Religions have three parameters: 1. Type of religion: Polytheism Henotheism Dualism Monotheism Ethical system Secular philosophy Animism 2. Organizational structure: Lack of structure Decentralization Centralization 3. Type of organization: Cult Church Each of the religions has a certain level of influence, which depends on the development of religious areas where this religion prevails. 12. Economy Types of economic processes include hunting, fishing, cattle breeding, agriculture, extraction of raw materials, commodity production, slavery. Hunting - with the help of hunting the tile gets a certain amount of vegetables, fruits, meat and cattle from all the unprocessed subtiles. Fishing is carried out in river locations, as well as in water coastal locations. Similarly, the hunting region gets some amount of fish and pearls. Cattle breeding is a more productive type of activity. The area of pasture lands is important for cattle breeding. It depends on the type of landscape, the type of buildings and the level of woodiness of the tile. Pastures as source of improvement of locations increase the effective area of pasture lands. The lack of grazing lands leads to a decrease in the number of cattle in the region. Agriculture is the most massive type of economic activity in the game. It includes the largest number of working hands. Grain is both a product of agriculture and a necessary condition for its maintenance. Grain is distributed to locations from the region's reserves. The amount of grain that will be used for sowing depends on two things: Arable land area; Number of working hands and intensification of agriculture. Livestock, as well as improved instruments of labour, can increase productivity. Types of property: Property of a strata Property of a faction Communal property Regional property (owned by the regional elite) State Property Among the strata and factions holders can be small, medium or large. Each of the types of property has a certain entrepreneurial potential. So, the entrepreneurial potential of the community is lower than that of small holders. On the other hand, the community is extremely effective in difficult conditions of management. Dividing the economy into white and shadow Goods have a certain level of utility for the population Inflation = money supply * speed of money circulation = level of prices * production volume Trade Trade in the game is divided into internal, external and distant. Internal trade is carried out in the territory of one country between all the settlements having trade routes with each other. External trade is carried out between all the regions of one trade center. Long-distance trade is carried out between two connected trade routes by trade centers. A trade route is a regular land and/or sea path connecting two settlements with each other and the regional capital with the army it supplies. If a trade route is overloaded, first of all it is used for delivery of the most profitable goods. To plunder the trade route one only needs to put an army on it, whereas two mechanics are provided for protection: Allocate funds for the protection of trade lines (then in case the allocated funds surpass the force of bandits, the attacks are considered to be beaten and the squad of bandits bears losses); Place armies at unprotected areas (the area of protection can be selected by moving the slider in the army menu. The larger the area is, the more dispersed the army is along the route and the weaker it is in protection). Pricing The price of the goods is determined basing on the cost of production + costs of implementation + mark-up. The mark-up is determined automatically based on the maximization of profit, competition and price constraints. Resources Resources include raw materials or goods necessary for the production of another resource or satisfaction of the needs of the population or the army, maintenance of buildings or spending on certain actions. Types of resources 1. Food: Meat, fish, grain, vegetables, fruits, canned food, alcohol 2. Agricultural: Agricultural resources, cattle (cattle, pack animals), technical crops 3. Industrial: Construction materials, wood, leather, fibre, fabrics, paper, tools, weapons, luxury, consumer goods, machinery, electronics, prom goods, energy, ships, cars, airplanes, trains, fuel, consumer products, medicines, chemicals, plastics, local products 4. Strategic: Metals (copper, tin, iron, aluminum), energy (coal, oil, gas, uranium), sulfur, gold, silver, precious stones 5. Services, Slaves Resource characteristics Quality is the quality of the resource, depending on the technologies used for its production. It affects the cost and mark-up. Price is the amount of gold per unit of the resource. It depends on the value of demand and the value of the supply of the resource, as well as its production cost. Production is the number of units of the resource produced. Consumption is the number of consumed units of the resource. The principle of movement of resources in the course of trading can be given on the example of grain: - Peasants produce a certain amount of grain and then either pay a natural tax, or sell it in the local market, and then pay the tax in monetary terms. The remaining volume of grain is used as food, for new sowing and, if there are surpluses, for sale in the local market. - The tax paid by the peasants passes to the ownership of the country or regional elite. - Regional elites either pass a part of the received tax to the state, or leave all to themselves, depending on the established order. Available resources can be both sold and spent on their own regional needs. - Finally, merchants who buy a resource in the local market sell it at a shopping centre which the region belongs to, or in the capital of a region of one state at a more attractive price. 13. Science The technologies in the game have three levels: The first level of technology represents the general level of development of one or another sphere: agricultural, industrial, military or social. The second level of technology includes specific technologies, the condition for the invention of which is, among other, a certain level of technologies of the first type. The third level of technology is technological packages that group second-level technologies. It is technological packages that set the effect for different systems in the game. Technology implementation Implementation of technologies is carried out by means of investment by the state or population of money resources and administrative resource into introduction of a technology. The bigger an industry in which a certain technology is implemented is and the less well-known countries and regions of the country with this implemented technology exist, the more expensive the implementation is. Technology Exchange Countries active in trade are increasing the chance of implementing the technologies that had been introduced by the trading partner. 14. Military action The main resource of the army are recruits. The number of recruits reflects the number of people who the authorities are able to transfer to military service. The number of recruits is slowly increasing over time, but is quickly exhausted in intense military conflicts. Officers Officers are a separate category in the army. They are recruited as part of recruiting, but the ability to occupy this position can be closed for some of the countries. Army and control zones Army is a group of troops under a single command with its control zone. A control zone is divided into a response zone and a combat zone. As a rule, the response zone has a radius of 4 tiles. When an alien army enters it, it activates the line of behavior set by the player. The combat zone is an area of 1-cell radius. When an alien army enters it, it stops its movement and forces the player to enter the battle. Moreover, with the growth of military technologies and, consequently, the scale of wars, the control zone can increase significantly. Thus, the zone of control in positional warfare, typical of world wars, can reach the size of the region. Supply and replenishment of the army Each army must be assigned to one or more regions. The designated regions will continue to supply this army. Replenishment of the army reserves is carried out through a trade route of supply from the region to which the army is assigned. Roads can contribute significantly to accelerating the supply of armed forces. In addition, it is possible to replenish stocks by plundering the local population. The fighting efficiency of the army, left without supplies, sharply falls, while the speed of movement decreases and action points are reduced. It also means that in order to win over a strong army it is not necessary to win it in an open battle - it is enough to cut the lines of supply communication. Replenishment of the army is also carried out through trade routes of supply, which in addition to supplies (food, weapons, pack animals) will transfer new recruits. Reinforcements It is possible for armies to establish automatic reinforcements for other armies of the player located on its territory or in the zone of another army’s control. Movements, military operations and tactical schemes At the beginning of the turn each army has a certain number of action points (AP), which can be spent on a movement, the beginning of the battle, siege or change of the state of the army. The AP cost of the movement depends on the area and infrastructure development. Speed of the army equals the speed of the slowest kind of troops in it. The army can have four states: Combat readiness is a standard condition that does not give any certain bonuses; Marsh allows the army to move twice as fast, but twice as low as the protection characteristics. However, it is possible to attack another army during the marsh; Camp is a recommended condition for peace time. It allows not to spend a lot of supplies on the army, but it is particularly vulnerable in this state as both the characteristics of attack and protection decrease. You need to spend all the AP to move into another state; Ambush gives the army a chance to escape from the enemy’s visibility distance, increasing the characteristics of the attack, but reducing the protection characteristics in case of ambush exposure. The army can adapt up to three different tactical circuits. Tactical schemes increase the combat characteristics of some troops, but can reduce the combat characteristics of others. Or they can amplify some combat characteristics, but reduce the others. For example, the tactical scheme "phalanx" increases the close-in attack for spearmen in general and against cavalry in particular, but it decreases the speed of movement and its ability to maneuver. Therefore, in such a tactical scheme additional attention should be paid to the saturation of their army with cavalry. A tactical scheme is also a familiar pattern in the fight, the way of thinking for the generals, so change of an accepted tactical scheme can be quite painful: it leads to a loss of experience for the entire army. Battles between armies in the open field At the end of the turn for the enemy armies, which came together at a normal location (without a fortress or city), the battle is calculated. The battle consists of two phases. The "Long-range combat" phase. It involves all the troops capable of a long-range attack. The "Close-in combat" phase. All the troops are involved in it. Only a limited number of troops can participate directly in the battle. Their number depends on the technology and the area. The rest of the troops are in the standby mode. For example, in the mountains it is quite possible to stop quite a large army. The formal winner of the battle is the one who leaves the battlefield. However, the gained experience and state of the army after the battle play a larger role. Siege of cities and fortresses. City fights It is impossible to take a fortress or a fortified capital without siege-assault engines. Also taking a fortress or fortified capital always requires a minimum of 2 turns. In the first stage of assault it is necessary to break the fortifications and enter the besieged settlement. The battle at this stage consists of two phases. The "Long-range assault" phase. It involves all the troops capable of a long-range attack and siege-assault engines of the attacker. The "Close-in assault" phase. The purpose of this phase for the attackers is to capture the wall of the settlement, and for the defenders-trivia attack. If the attacker managed to capture the walls, the next turns begins with the battle for the settlement by the rules of the battle in the open field. However, for the final victory the attackers must destroy all the troops of the defenders, and not just win. Only then the settlement will be completely seized. Thus, battles for cities, which consist of more than one location, can last during more than 3 turns, as each part of the city will have to be captured separately. Fleet Fleet is a group of ships under the authority of a single commander with its control zone. As a rule, the zone of control is an area with a radius of 3-6 locations. When the alien fleet enters it, it leads to the sea battle. The radius of the control zone increases with the growth of technologies and experience of the fleet crew. Fleet Supply and Repair Unlike the army, the fleet is not assigned to any region and is supplied by all of them. To exit the port, the fleet can bring a limited amount of supplies. Supplies include food, weapons and building materials. For replenishment of supplies it is possible to go to any friendly port. The fleet, left without supplies, sharply loses fighting efficiency while the speed of swimming decreases and action points get reduced. During the battle ships can get damaged or lose a part of the team - to repair and replenish the team again you have to go to a friendly port. Swimming and sea battles The fleet receives a number of action points (AP), which can be spent on swimming, repair and replenishment of supplies, boarding and landing of the army and the beginning of sea battles. The sea battle is not divided into phases and represents individual battles between ships of fleets. The formal winner is the one who retained the highest morale of the fleet.
  3. I have rewritten this function a few times now and I am having trouble getting every other row to have the triangles face the reverse direction. The image enclosed demonstrates the faulty behavior which includes only one row facing the reversed direction. I am also confused by how many indexes I should have for the g_vertex_buffer_data_land variable, could someone show me a breakdown like : 18 vertices times 2 sets times 8 columns times 8 depth. In another post fleabay mentioned I was not setting a VAO in core profile, however It seems to be. here is the code: float* getVertices(void) { //using defines int incol = _colus; int depth = _depth; int i = 0; float scaleit = .5; float tempdepth = 0; int startindexat = 0; int counter = 0; int secondcounter = 0; //for (; (tempdepth+1) <= (depth);) //don't forget to change this back! for (int q=0;q<3;q++) { //odd rows for (int col = 0; (col+1) <= (incol ); col++) { GLfloat matrix1[3][3] = { {(col + 1),0,(tempdepth)},{ (col),0,(tempdepth)}, {(col),0,(tempdepth + 1) } }; // //vertex 1 g_vertex_buffer_data_land[startindexat + 0 + counter] = matrix1[0][0] * scaleit; g_vertex_buffer_data_land[startindexat + 1 + counter] = matrix1[0][1] * scaleit; g_vertex_buffer_data_land[startindexat + 2 + counter] = matrix1[0][2] * scaleit; //vertex 2 g_vertex_buffer_data_land[startindexat + 3 + counter] = matrix1[1][0] * scaleit; g_vertex_buffer_data_land[startindexat + 4 + counter] = matrix1[1][1] * scaleit; g_vertex_buffer_data_land[startindexat + 5 + counter] = matrix1[1][2] * scaleit; g_vertex_buffer_data_land[startindexat + 6 + counter] = matrix1[2][0] * scaleit; g_vertex_buffer_data_land[startindexat + 7 + counter] = matrix1[2][1] * scaleit; g_vertex_buffer_data_land[startindexat + 8 + counter] = matrix1[2][2] * scaleit; int matrix2[3][3] = { { (col + 1),0,(tempdepth + 1)},{ (col + 1),0,(tempdepth)}, {(col),0,(tempdepth + 1) } }; g_vertex_buffer_data_land[startindexat + 9 + counter] = matrix2[0][0] * scaleit; g_vertex_buffer_data_land[startindexat + 10 + counter] = matrix2[0][1] * scaleit; g_vertex_buffer_data_land[startindexat + 11 + counter] = matrix2[0][2] * scaleit; g_vertex_buffer_data_land[startindexat + 12 + counter] = matrix2[1][0] * scaleit; g_vertex_buffer_data_land[startindexat + 13 + counter] = matrix2[1][1] * scaleit; g_vertex_buffer_data_land[startindexat + 14 + counter] = matrix2[1][2] * scaleit; g_vertex_buffer_data_land[startindexat + 15 + counter] = matrix2[2][0] * scaleit; g_vertex_buffer_data_land[startindexat + 16 + counter] = matrix2[2][1] * scaleit; g_vertex_buffer_data_land[startindexat + 17 + counter] = matrix2[2][2] * scaleit; counter = counter + 18; }//end col startindexat = 17 + counter+ 1; for (int col2 = 0; (col2+1) <= (incol); col2++) { //first triangle : even rows GLfloat matrix3[3][3] = { {(col2 + 1) ,0,(tempdepth + 2)} , {(col2 + 1),0,(tempdepth + 1)}, {(col2),0,(tempdepth +1)} }; // //vertex 1 g_vertex_buffer_data_land[(startindexat + secondcounter)] = matrix3[0][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 1 + secondcounter)] = matrix3[0][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 2 + secondcounter)] = matrix3[0][2] * scaleit; //vertex 2 g_vertex_buffer_data_land[(startindexat + 3 + secondcounter)] = matrix3[1][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 4 + secondcounter)] = matrix3[1][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 5 + secondcounter)] = matrix3[1][2] * scaleit; g_vertex_buffer_data_land[(startindexat + 6 + secondcounter)] = matrix3[2][0] * scaleit; g_vertex_buffer_data_land[(startindexat + 7 + secondcounter)] = matrix3[2][1] * scaleit; g_vertex_buffer_data_land[(startindexat + 8 + secondcounter)] = matrix3[2][2] * scaleit; // even (2) int matrix4[3][3] = { {(col2 + 1),0,(tempdepth+ 2)},{ (col2),0,(tempdepth+ 1)}, {(col2),0,(tempdepth + 2) } }; g_vertex_buffer_data_land[(startindexat+9 + secondcounter)] = matrix4[0][0] * scaleit; g_vertex_buffer_data_land[(startindexat+10 + secondcounter)] = matrix4[0][1] * scaleit; g_vertex_buffer_data_land[(startindexat+11 + secondcounter)] = matrix4[0][2] * scaleit; g_vertex_buffer_data_land[(startindexat+12 + secondcounter)] = matrix4[1][0] * scaleit; g_vertex_buffer_data_land[(startindexat+13 + secondcounter)] = matrix4[1][1] * scaleit; g_vertex_buffer_data_land[(startindexat+14 + secondcounter)] = matrix4[1][2] * scaleit; g_vertex_buffer_data_land[(startindexat+15 + secondcounter)] = matrix4[2][0] * scaleit; g_vertex_buffer_data_land[(startindexat+16 + secondcounter)] = matrix4[2][1] * scaleit; g_vertex_buffer_data_land[(startindexat+17 + secondcounter)] = matrix4[2][2] * scaleit; //one column of 4 triangles //(three vetices per triangle) secondcounter = secondcounter + 18; } startindexat = 17 + secondcounter + 1; tempdepth = tempdepth - 1; } return gvertices; } I am hoping someone might have the experience to help me solve this problem. Or, what could I check and do I need to show more repo code? Thank you, Josheir
  4. This is a follow up to a previous post. MrHallows had asked me to post the project, so I am going to with a new fresh thread so that I can get the most needed help. I have put the class in the main .cpp to simplify for your debugging purposes. My error is : C1189 #error: OpenGL header already included, remove this include, glad already provides it I tried adding : #define GLFW_INCLUDE_NONE, and tried adding this as a preprocessor definitions too. I also tried to change the #ifdef - #endif, except I just couldn't get it working. The code repository URL is : https://github.com/Joshei/GolfProjectRepo/tree/combine_sources/GOLFPROJ The branch is : combine_sources The Commit ID is: a4eaf31 The files involved are : shader_class.cpp, glad.h, glew.h glad1.cpp was also in my project, I removed it to try to solve this problem. Here is the description of the problem at hand: Except for glcolor3f and glRasterPos2i(10,10); the code works without glew.h. When glew is added there is only a runtime error (that is shown above.) I could really use some exact help. You know like, "remove the include for gl.h on lines 50, 65, and 80. Then delete the code at line 80 that states..." I hope that this is not to much to ask for, I really want to win at OpenGL. If I can't get help I could use a much larger file to display the test values or maybe it's possible to write to an open file and view the written data as it's outputted. Thanks in advance, Josheir
  5. I have a texture I'm reading from like this: vec4 diffuseFrag = texture2D(DiffuseMap, fDiffuseCoord); Sometimes, for special effects, I'd actually like to do something this: vec4 uvFrag = texture2D(UVMap, fUVCoord); vec4 diffuseFrag = texture2D(DiffuseMap, uvFrag.rg); ...basically, I'm using a texture's Red and Green color channels to store the frag coordinates I want to read from DiffuseMap. My probably is, both the UV map and the Diffuse map are spritesheets with multiple images in them. This means, I'm actually wanting uvFrag.rg's (0-1) texcoord to be multiplied against the *subportion* of the texture that all four vertices of my fDiffuseCoord are referring to. Something like: vec4 uvFrag = texture2D(UVMap, fUVCoord).rg; vec4 upperLeftOfSubrect = ...; vec4 bottomRightOfSubrect = ...; vec4 subrectSize = (bottomRightOfSubrect - upperLeftOfSubrect); uvFrag = upperLeftOfSubrect + (uvFrag * range); vec4 diffuseFrag = texture2D(DiffuseMap, uvFrag.rg); Where my mind is going blank is, how can I get upperLeftOfSubrect / bottomRightOfSubrect, without bloating my vertex struct further with additional attributes? It mentally trips me up that I'll have to copy upperLeftOfSubrect / bottomRightOfSubrect into all four of my vertices... and triply annoys me because I'm already passing them in as fDiffuseCoord (just spread between different vertices). Is there a simple solution to this that I'm missing?
  6. So I've started in learning OpenGL , then I found the NeHe website and its Legacy Tutorials (here is the link http://nehe.gamedev.net/tutorial/lessons_01__05/22004/ ).But the problem is that I can't download any examples of code ( neither C code examples nor any other language ) .As you see it is impossible to download http://nehe.gamedev5.net/data/lessons/pelles_c/lesson01.zip . Does anyone has expamles of C code of this lessons ? And the second question. If I prefer coding on C , should I choose GLUT but not an OpenGL ?
  7. I am trying to use : OpenGL and draw some simple text quickly. However I cannot get the top two commands to define. glColor3f(rgb.r, rgb.g, rgb.b); glRasterPos2f(x, y); glutBitmapString(font, string); I tried this : #include <C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Include/gl/GL.h> May I have some help please. The last command which is with glut is fine. Apparently, the problem is not with GLUT or FreeGlut, but with Visual Studio headers. I am using Visual Studio 2017, C++. Thank you, Josheir
  8. Hello! I'm trying to understand how to load models with Assimp. Well learning how to use this library isn't that hard, the thing is how to use the data. From what I understand so far, each model consists of several meshes which you can render individually in order to get the final result (the model). Also from what assimp says: One mesh uses only a single material everywhere - if parts of the model use a different material, this part is moved to a separate mesh at the same node The only thing that confuses me is how to create the shader that will use these data to draw a mesh. Lets say I have all the information about a mesh like this: class Meshe { std::vector<Texture> diffuse_textures; std::vector<Texture> specular_textures; std::vector<Vertex> vertices; std::vector<unsigned int> indices; } And lets make the simplest shaders: Vertex Shader: #version 330 core layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNormal; layout(location = 2) in vec2 aTexCoord; uniform vec3 model; uniform vec3 view; uniform vec3 projection; out vec2 TextureCoordinate; out vec3 Normals; void main() { gl_Position = projection * view * model * vec4(aPos, 1.0f); TextureCoordinate = aTexCoord Normals = normalize(mat3(transpose(inverse(model))) * aNormal); } Fragment Shader: #version 330 core out vec4 Output; in vec2 TextureCoordinate; in vec3 Normals; uniform sampler2D diffuse; uniform sampler2D specular; void main() { Output = texture(diffuse, TextureCoordinate); } Will this work? I mean, assimp says that each mesh has only one material that covers it, but that material how many diffuse and specular textures can it have? Does it makes sense for a material to have more than one diffuse or more that one specular textures? If each material has only two textures, one for the diffuse and one for the specular then its easy, i'm using the specular texture on the lighting calculations and the diffuse on the actual output. But what happens if the textures are more? How am i defining them on the fragment shader without knowing the actual number? Also how do i use them?
  9. Hello everyone, While I do have a B.S. in Game Development, I am currently unable to answer a very basic programming question. In the eyes of OpenGL, does it make any difference if the program uses integers or floats? More specifically, characters, models, and other items have coordinates. Right now, I am very tempted to use integers for the coordinates. The two reasons for this are accuracy and perhaps optimizing calculations. If multiplying two floats is more expensive in the eyes of the CPU, then this is a very powerful reason to not use floats to contain the positions, or vectors of game objects. Please forgive me for my naivette, and not knowing the preferences of the GPU. I hope this thread becomes a way for us to learn how to program better as a community. -Kevin
  10. I'm having trouble with glew sharing some defines that I can't resolve. Does anyone know of a way to get the following statements working instead of an include with glew (glew resolves the red squigglies too.) glColor3f(0, 1, 0.); glRasterPos2i(10,10); I really want to use a quick glut command for now. The command uses the statements above. Thank You, Josheir
  11. Hi all, I'm targeting OpenGL 2.1 (so no VAO's for me 😢) and I have multiple shaders rendering quite different things at each frame; for the sake of argument, say that I have just two shaders - one shader draws the background (so it uses vertex attributes for texture coordinates, 2D positions, etc.) while the other draws some meshes (so it uses vertex attributes for colors and 3D positions, and no textures). The data provided to each of the shaders changes for each frame. Now, I've realized I can choose between two different strategies when it comes to binding vertex attribute locations. With the first strategy I reuse vertex attribute indices, whereby the first shader would bind to, say, attribute locations 0, 1, 2, 3 and the second shader would bind to, say, 0, 1, 2. With this approach I'll have to constantly call glVertexAttribPointer for these indices, as for each frame one shader would require one set of VBO's to feed 0, 1, 2, 3 and the other shader would require another set of VBO's to feed 0, 1, 2. With the second strategy, instead, I use "dedicated" vertex attribute indices: the first shader would bind to 0, 1, 2, 3 and the second shader would bind to 4, 5, 6. In other words, each vertex attribute index has its own dedicated VBO to feed data to it. The advantage of this approach is that I need to call glVertexAttribPointer only once per index, say at program initialization, but at the same time it's limiting my capacity to "grow" shaders in the future (my GPU only supports 16 vertex attributes, hence it'll be hard to add new shaders or to add new attributes to existing shaders). Now, in my implementation I can't see any performance benefit of one versus the other, but truth to be told, I'm developing on an ancient Dell laptop with an Intel mobile card...😩 nonetheless I would like this code to run as fast as possible on modern GPU's. Is there any performance benefit to choosing one of the two strategies over the other? And in case there's no performance benefit, is one strategy preferable over the other for reasons that I can't think of at the moment? Thanks so much in advance for any tips!!!!
  12. Hello, I was just wondering whether it was a thing to use a component-based architecture to handle models in OpenGL much like in a entity component system. This structure has especially helped me in cases where I have models that need different resources. By that I mean, some models need a texture and texture coordinate data to go with it, others just need some color data (vec3). Some have a normals buffer whereas others just get their normals calculated on the fly (geometry shader). Some have an index buffer (rendered with glDrawElements) whereas others don't and get rendered using glDrawArrays etc... Instead of branching off into complicated hierarchies to create models that have only certain resources, or coming up with strange ways resolve certain problems concerning checking which resources some models have, I just attach components to each model such as a vertex buffer or texture coordinate buffer or index buffer etc... So, I was just wondering if I was using the other version of model handling wrong or whether this style of programming is a viable option and whether there are flaws that I am unable to foresee?
  13. So, there is one thing that i don't quite understand. (Probably because i didn't dive that deep into PBR lighting in the first place.) Currently, i implemented a very basic PBR renderer (with the BRDF microfaced shading model) into my engine. The lighting system i have is pretty basic (1 directional/sun light, deffered point lights and 1 ambient light) I don't have a GI solution yet. (Only a very basic world-space Ambient occlusion technique). Here is how it looks like: Now, what i would like to do is to give the shadows a slightly blueish tint. (To simulate the blueish light from the sky.) Unreal seems to implement this too which gives the scene a much more natural look: Now, my renderer does render in HDR and i use exposure/tonemapping to bring this down to LDR. The first image used an indirect light with a RGB value of (40,40,40) and an indirect light of (15,15,15). Here is the same picture but with an ambient light of (15,15,15) * ((109, 162, 255) / (255,255,255)) which should give us this blueish tint. The problem is it looks like this: The shadows do get the desired color (more or less) the issue is that all lit pixels also get affected giving the scene a blue tint. Reducing the ambient light intensity results in way too dark shadows. Increase the intensity and the shadows look alright but then the whole scene gets affected way too much. In the shader i basically have: color = directionalLightColor * max(dot(normal,sunNormal),0.0) + ambientLight; The result is that the blue component of the color will be always higher than the other two. I could of course fix it by faking it (only adding the ambient light if the pixel is in shadow) but i want to stay as close to PBR as possible and avoid adding hacks like that. My question is: How is this effect done properly (with PBR / proper physically based lighting)?
  14. Hello again Recently I was trying to apply 6 different textures in a cube and I noticed that some textures would not apply correctly, but if i change the texture image with another it works just fine. I can't really understand what's going on. I will also attach the image files. So does this might have to do anything with coding or its just the image fault??? This is a high quality texture 2048x2048 brick1.jpg, which does the following: And this is another texture 512x512 container.jpg which is getting applied correctly with the exact same texture coordinates as the prev one: Vertex Shader #version 330 core layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNormal; layout(location = 2) in vec2 aTexCoord; uniform mat4 model; uniform mat4 view; uniform mat4 proj; out vec2 TexCoord; void main() { gl_Position = proj * view * model * vec4(aPos, 1.0); TexCoord = aTexCoord; } Fragment Shader #version 330 core out vec4 Color; in vec2 TexCoord; uniform sampler2D diffuse; void main() { Color = texture(diffuse, TexCoord); } Texture Loader Texture::Texture(std::string path, bool trans, int unit) { //Reverse the pixels. stbi_set_flip_vertically_on_load(1); //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, 0); //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); //Not Transparent texture. if (!trans) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_width, m_height, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); } //Transparent texture. else { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data)); } //Generate mipmaps. GLCall(glGenerateMipmap(GL_TEXTURE_2D)); //Texture Filters. GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); } //Loading Failed. else throw EngineError("The was an error loading image: " + path); //Free the image data. stbi_image_free(data); } Texture::~Texture() { } void Texture::Bind(int unit) { GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); } Rendering Code: Renderer::Renderer() { float vertices[] = { // positions // normals // texture coords -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 1.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }; //Create the Vertex Array. m_vao = new Vao(); //Create the Vertex Buffer. m_vbo = new Vbo(vertices, sizeof(vertices)); //Create the attributes. m_attributes = new VertexAttributes(); m_attributes->Push(3); m_attributes->Push(3); m_attributes->Push(2); m_attributes->Commit(m_vbo); } Renderer::~Renderer() { delete m_vao; delete m_vbo; delete m_attributes; } void Renderer::DrawArrays(Cube *cube) { //Render the cube. cube->Render(); unsigned int tex = 0; for (unsigned int i = 0; i < 36; i += 6) { if (tex < cube->m_textures.size()) cube->m_textures[tex]->Bind(); GLCall(glDrawArrays(GL_TRIANGLES, i, 6)); tex++; } }
  15. Hi, I was studying making bloom/glow effect in OpenGL and following the tutorials from learnopengl.com and ThinMatrix (youtube) tutorials, but i am still confuse on how to generate the bright colored texture to be used for blur. Do I need to put lights in the area of location i want the glow to happen so it will be brighter than other object in the scene?, that means i need to draw the scene with the light first? or does the brightness can be extracted based on how the color of the model was rendered/textured thru a formula or something? I have a scene that looks like this that i want to glow the crystal can somebody enlighten me on how or what the correct approach is? really appreciated!
  16. phil67rpg

    plane game

    well I have drawn two plane sprites and have them move around the screen using keys. one them can also shoot bullets, I have drawn an animated collision sprite
  17. I'm currently learning how to import models. I created some code that works well following this tutorial which uses only one sampler2D in the fragment shader and the model loads just fine with all the textures. The thing is what happens when a mesh has more than one textures? The tutorial says to define inside the fragment shader N diffuse and specular samplers with the format texture_diffuseN, texture_specularN and set them via code, where N is 1,2,3, .. , max_samplers. I understand that but how do you use them inside the shader? In the tutorial the shader is: #version 330 core out vec4 FragColor; in vec2 TexCoords; uniform sampler2D texture_diffuse1; void main() { FragColor = texture(texture_diffuse1, TexCoords); } which works perfectly for the test model that the tutorial is giving us. Now lets say you have the general shader: #version 330 core out vec4 FragColor; in vec2 TexCoords; uniform sampler2D texture_diffuse1; uniform sampler2D texture_diffuse2; uniform sampler2D texture_diffuse3; uniform sampler2D texture_diffuse4; uniform sampler2D texture_diffuse5; uniform sampler2D texture_diffuse6; uniform sampler2D texture_diffuse7; uniform sampler2D texture_specular1; uniform sampler2D texture_specular2; uniform sampler2D texture_specular3; uniform sampler2D texture_specular4; uniform sampler2D texture_specular5; uniform sampler2D texture_specular6; uniform sampler2D texture_specular7; void main() { //How am i going to decide here which diffuse texture to output? FragColor = texture(texture_diffuse1, TexCoords); } Can you explain me this with a cube example? Lets say i have a cube which is a mesh and i want to apply a different texture for each face (6 total). #version 330 core out vec4 FragColor; in vec2 TexCoords; uniform sampler2D texture_diffuse1; uniform sampler2D texture_diffuse2; uniform sampler2D texture_diffuse3; uniform sampler2D texture_diffuse4; uniform sampler2D texture_diffuse5; uniform sampler2D texture_diffuse6; void main() { //How am i going to output the correct texture for each face? FragColor = texture(texture_diffuse1, TexCoords); } I know that the text coordinates will apply the texture at the correct face, but how do i now which sampler to use every time the fragments shader is called? I hope you understand why I'm frustrated. Thank you
  18. babaliaris

    OpenGL Fragment Position

    Take a Look at my Shaders: Vertex Shader: #version 330 core layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNormal; uniform mat4 model; uniform mat4 view; uniform mat4 proj; out vec3 FragPos; out vec3 Normal; void main() { gl_Position = proj * view * model * vec4(aPos, 1.0); FragPos = vec3(model * vec4(aPos, 1.0)); Normal = normalize(mat3(transpose(inverse(model))) * aNormal); } Fragment Shader: #version 330 core out vec4 Color; uniform vec3 viewPos; struct Material { vec3 ambient; vec3 diffuse; vec3 specular; float shininess; }; uniform Material material; struct Light { vec3 position; vec3 ambient; vec3 diffuse; vec3 specular; }; uniform Light light; in vec3 FragPos; in vec3 Normal; void main() { //Calculating the Light Direction From The Fragment Towards the light source. vec3 lightDirection = normalize(light.position - FragPos); //Calculating the camera direction. vec3 camDirection = normalize(viewPos - FragPos); //Calculating the reflection of the light. vec3 reflection = reflect(-lightDirection, Normal); //Calculating the Diffuse Factor. float diff = max( dot(Normal, lightDirection), 0.0f ); //Calculate Specular. float spec = pow( max( dot(reflection, camDirection), 0.0f ), material.shininess); //Create the 3 components. vec3 ambient = material.ambient * light.ambient; vec3 diffuse = (material.diffuse * diff) * light.diffuse; vec3 specular = (material.specular * spec) * light.specular; //Calculate the final fragment color. Color = vec4(ambient + diffuse + specular, 1.0f); } I can't understand how this: FragPos = vec3(model * vec4(aPos, 1.0)); is actually the fragment position. This is just the vertex position transformed to world coordinates. The vertex shader is gonna get called n times where n is the number of vertices, so the above code is also going to get called n times. The actual fragments are a lot more so how can the above code generate all the fragments positions? Also what is a fragments position? Is it the (x,y) you need to move on the screen in order to find that pixel? I don't think so because i read that while you are in the fragment shader the actual pixels on the screen have not been determined yet because the viewport transformation happens at the end of the fragment shader.
  19. In the gif image below you can see the effect that my code produces. When I do not rotate the cube, diffuse lighting works properly (faces that face the light source are brighter) but when i rotate the cube this is what happens: GIF Cube's Vertex Shader. #version 330 core layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNormal; uniform mat4 model; uniform mat4 view; uniform mat4 proj; out vec3 FragPos; out vec3 Normal; void main() { gl_Position = proj * view * model * vec4(aPos, 1.0); FragPos = vec3(model * vec4(aPos, 1.0)); Normal = normalize(aNormal); } Cube's Fragment Shader. #version 330 core out vec4 Color; uniform vec3 lightPos; uniform vec3 lightColor; uniform vec3 objectColor; in vec3 FragPos; in vec3 Normal; void main() { float ambient = 0.3f, diffuse; vec3 result; vec3 lightDirection = normalize(lightPos - FragPos); diffuse = max( dot(Normal, lightDirection), 0.0f ); result = (ambient + diffuse) * lightColor; Color = vec4(result * objectColor, 1.0f); } Cube's Bindings And Matrices Code (This code is called every frame for each cube object): void Cube::Render() { //---------------------Run The Brains---------------------// for (unsigned int i = 0; i < m_brains->size(); i++) { //Call the Start Method. if (m_brains->at(i)->m_started) { m_brains->at(i)->Start(); m_brains->at(i)->m_started = false; } //Call the Update Method. else { m_brains->at(i)->Update(); } } //---------------------Run The Brains---------------------// //Bind everything before the draw call. m_texture->Bind(); m_program->Bind(); //Initialize the mvp transformations. glm::mat4 model = glm::mat4(1.0f); glm::mat4 view = glm::mat4(1.0f); glm::mat4 proj = glm::mat4(1.0f); //Translate. model = glm::translate(model, m_pos); //Rotate the model. model = glm::rotate(model, glm::radians(m_rotation.x), glm::vec3(1.0f, 0.0f, 0.0f)); model = glm::rotate(model, glm::radians(m_rotation.y), glm::vec3(0.0f, 1.0f, 0.0f)); model = glm::rotate(model, glm::radians(m_rotation.z), glm::vec3(0.0f, 0.0f, 1.0f)); //Scale. model = glm::scale(model, m_scale); //View. view = m_core->m_cam->GetView(); //Projection. proj = glm::perspective(glm::radians(m_core->m_cam->m_fov), (float)m_core->m_width / m_core->m_height, 0.1f, 100.0f); //Set the tranformation matrices on the shader. m_program->SetUniformMat4f("model", model); m_program->SetUniformMat4f("view", view); m_program->SetUniformMat4f("proj", proj); //Draw. GLCall(glDrawArrays(GL_TRIANGLES, 0, 36)); } Vertex Data: float vertices[] = { //Positions //Normals -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, -0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f, -0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f, -0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f, 0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, 0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, -0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f, -0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f, -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f }; //Create the Vertex Array. m_vao = new Vao(); //Create the Vertex Buffer. m_vbo = new Vbo(vertices, sizeof(vertices)); //Create the attributes. m_attributes = new VertexAttributes(); m_attributes->Push(3); m_attributes->Push(3); m_attributes->Commit(m_vbo);
  20. thecheeselover

    Zone generation

    Subscribe to our subreddit to get all the updates from the team! I have integrated the zone separation with my implementation of the Marching Cubes algorithm. Now I have been working on zone generation. A level is separated in the following way : Shrink the zone map to exactly fit an integer number of Chunk2Ds, which are of 32² m². For each Chunk2D, analyse all zones inside its boundaries and determine all possible heights for Chunk3Ds, which are of 32³ m³. Imagine this as a three dimensional array as an hash map : we are trying to figure out all keys for Chunk3Ds for a given Chunk2D. Create and generate a Chunk3D for each height found. Execute the Marching Cubes algorithm to assemble the geometry for each Chunk3D. In our game, we want levels to look like and feel like a certain world. The first world we are creating is the savanna. Even though each Chunk3D is generated using 3D noise, I made a noise module to map 3D noises into the 2D to able to apply 2D perturbation to the terrain. I also tried some funkier procedural noises : An arch! The important thing with procedural generation, it's to have a certain level of control over it. With the new zone division system, I have achieved a minimum on that path for my game.
  21. Subscribe to our subreddit to get all the updates from the team! Recently I've been tackling with more organic low poly terrains. The default way of creating indices for a 3D geometry is the following (credits) : A way to create simple differences that makes the geometry slightly more complicated and thus more organic is to vertically swap the indices of each adjacent quad. In other words, each adjacent quad to a centered quad is its vertical mirror. Finally, by not sharing the vertices and hence by creating two triangles per quad, this is the result with a coherent noise generator (joise) : It is called flat shading.
  22. I'm doing research at the moment, and I came across some interesting things with Window Styles for OpenGL on Windows platform: WS_CLIPCHILDREN and WS_CLIPSIBLINGS are both required for OpenGL applications. WS_POPUP is preferred over WS_OVERLAPPEDWINDOW, WS_OVERLAPPED, and WS_POPUPWINDOW. But, it didn't say if it's required, or it's explicitly not necessary for OpenGL applications. WS_BORDER is also required for OpenGL applications. WS_VISIBLE is necessary as a precaution. So all of those explanations are just comments and posts spread out across many different forums, answer posts, StackOverflow, and on old MSDN blog comments. There's too many to list, so I just wanted brevity over having to cite out quite a bit of references. Anyway, what I personally don't understand about the Window Styles is: How do I describe the effects of WS_CLIPCHILDREN and WS_CLIPSIBLINGS on an OpenGL application? Its uses has some uses related to how OpenGL applications have their own pixel formats supported by the device context, and how it may be possible for a parent window to spawn children windows and somehow, miraculously clipping each other. Or, maybe the flag is put there mainly so the parent window, or the primary OpenGL application window, is prevented from being clipped by any children and parent siblings (windows)? Why is it preferrable to use WS_POPUP over WS_OVERLAPPEDWINDOW? I am speculating it has to do with toggling fullscreen and windowed mode for any OpenGL application, but, does that mean, just by setting WS_POPUP, it is enough to have fullscreen toggling support? Or, does it require that the window itself need to set/remove certain Window Styles, so WS_POPUP = fullscreen, and then WS_OVERLAPPED | ~(WS_POPUP) is used for windowed mode? Why is WS_VISIBLE necessary? Does that mean it can skip a step for setting the window to be visible? WS_BORDER is for windowed mode only, and thus it's required? Or that fullscreen and windowed mode both need WS_BORDER to function? So, those are my questions I have right now. Am I correct to assume all if these? Thanks in advance.
  23. EDIT: SOLVED - MORE OR LESS! I have been trying to get a .obj file to load and display in three dimensions. The object is a cube. I have spent three days on this and need help, please! I have tried numerous .obj files trying to get it to work. I replaced the double slashes with single slashes in the .obj file so that the super simple loader can get the vertexes and indices. Since I am very stuck, the help would be greatly effective to my experience/learning, may I have the help, please? ALso, recently I switched the functionality from : glDrawArrays (GL_TRIANGLES, 0, 3); to lDrawElements( GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0); The code is here (pastebin) https://pastebin.com/cTLuqaae The .png of the model and the .obj file are attached too. Thank you, Josheir My email is Joshuaeirm@gmail.com. cube100.obj
  24. phil67rpg

    shooting bullets

    well I am able to get my sprites to rotate and move in all directions, I have drawn two plane sprites, I am also able to shoot a bullet in the up direction, I want to shoot bullets in all directions just like my plane rotates, I just need a hint on how to proceed, go easy on me this is new stuff to me. However I am making progress.
  25. I tried to port DirectX program to OpenGL version. My planets were inverted horizontally (opposite rotation Y axis). Z-coordinate was inverted too. I figured them out for some months. I finally recognized that there are two different coordinate systems - left-handed and right-handed. DirectX uses left-handed coordinate but OpenGL uses right-handed coordinate as default. I googled it and learned a lot. I prefer left-handed coordinate system for easy programming instead. Also I tried google projection matrix formula for left-handed coordinate but did not find any sources. Does anyone know any matrix formula for left-handed coordinate system? Does anyone know any good guides for DirectX to OpenGL conversion for porting? Tim
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!