Тема нативних движків, що спрощують роботу з 3D графікою для Android, є головним болем багатьох розробників. У той час як для iOS існує SceneKit, розробники під Android були змушені або йти в крос-платформені рішення (Unity3d, LibGDX і т.п.) або використовувати самописні/опенсорсні рішення з обмеженим функціоналом. Поява Sceneform SDK вирішує не тільки цю проблему але й інкапсулює в собі роботу з ArCore SDK, відкриваючи для розробників можливість нативної реалізації AR рішень, не вдаючись до стороннього SDK.
В рамках доповіді будуть розглянуті практичні можливості та обмеження Sceneform SDK стосовно проектів з доповненою реальністю (AR). Так само будуть розглянуті такі теми як SLAM, ArCore SDK, розпізнавання та трекінг маркерів на основі зображень, Cloud Anchors та існуючі альтернативи на ринку.
The document describes functional lenses in C++. It discusses how lenses allow functional, immutable updates to nested data structures by focusing on a nested element and updating just that element. Lenses hide the data structure implementation and allow composable, reusable updates. The document outlines an implementation of lenses in C++ using templates, getter/setter functions, and lens composition. It also describes using the cpp_lenses library to work with containers and traverse nested elements.
The composite pattern allows objects to be composed into tree structures to represent part-whole hierarchies. It allows clients to treat individual objects and compositions uniformly. The example shows how shapes like lines and rectangles can be composed into pictures. Individual shapes are leaf classes while pictures are composite classes that can group shapes together and be treated the same way as individual shapes by clients.
Android UI Development: Tips, Tricks, and TechniquesEdgar Gonzalez
Presentation of @romainguy and @chethaase at Devoxx and the San Francisco Android user group.
Shows what tools they use to track down performance issues.
The document discusses various OpenGL graphics techniques including viewports, depth buffering, handling input, using 3D models, drawing primitives, fog, displaying text, collision detection, picking objects, lens flares, and particle systems. Specifically, it provides code examples for setting the viewport, depth testing, handling keyboard input, loading and drawing 3D models, drawing spheres and cylinders using GLU functions, applying fog, displaying text, approximating collision detection using spheres, picking objects using the picking matrix, creating lens flares using the projection matrix, and generating particle systems for effects like dust and fire.
The document describes a design recipe process with 6 steps: 1) information analysis and data design, 2) contract and purpose statement, 3) examples, 4) design strategy, 5) function definition, and 6) tests. It then provides examples of applying functional and object-oriented programming approaches to a design problem involving circles, squares, and composite shapes. Code snippets demonstrate transforming the design from using functions to using classes and methods.
Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. It was developed in the early 1980s at Stepstone. In the late 1980s, Objective-C was selected as the main programming language for NeXTSTEP and was later adopted by Apple for Mac OS X and iOS software development. Major features of Objective-C include object-oriented programming, dynamic typing, automatic memory management, and a flexible syntax that supports protocol-oriented programming.
The document describes functional lenses in C++. It discusses how lenses allow functional, immutable updates to nested data structures by focusing on a nested element and updating just that element. Lenses hide the data structure implementation and allow composable, reusable updates. The document outlines an implementation of lenses in C++ using templates, getter/setter functions, and lens composition. It also describes using the cpp_lenses library to work with containers and traverse nested elements.
The composite pattern allows objects to be composed into tree structures to represent part-whole hierarchies. It allows clients to treat individual objects and compositions uniformly. The example shows how shapes like lines and rectangles can be composed into pictures. Individual shapes are leaf classes while pictures are composite classes that can group shapes together and be treated the same way as individual shapes by clients.
Android UI Development: Tips, Tricks, and TechniquesEdgar Gonzalez
Presentation of @romainguy and @chethaase at Devoxx and the San Francisco Android user group.
Shows what tools they use to track down performance issues.
The document discusses various OpenGL graphics techniques including viewports, depth buffering, handling input, using 3D models, drawing primitives, fog, displaying text, collision detection, picking objects, lens flares, and particle systems. Specifically, it provides code examples for setting the viewport, depth testing, handling keyboard input, loading and drawing 3D models, drawing spheres and cylinders using GLU functions, applying fog, displaying text, approximating collision detection using spheres, picking objects using the picking matrix, creating lens flares using the projection matrix, and generating particle systems for effects like dust and fire.
The document describes a design recipe process with 6 steps: 1) information analysis and data design, 2) contract and purpose statement, 3) examples, 4) design strategy, 5) function definition, and 6) tests. It then provides examples of applying functional and object-oriented programming approaches to a design problem involving circles, squares, and composite shapes. Code snippets demonstrate transforming the design from using functions to using classes and methods.
Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. It was developed in the early 1980s at Stepstone. In the late 1980s, Objective-C was selected as the main programming language for NeXTSTEP and was later adopted by Apple for Mac OS X and iOS software development. Major features of Objective-C include object-oriented programming, dynamic typing, automatic memory management, and a flexible syntax that supports protocol-oriented programming.
PDF.js is a JavaScript library for rendering PDF files in the browser without using native code plugins. It works by parsing PDF files and converting the drawing commands into an intermediate representation, then executing those commands on a canvas to display the PDF content. One challenge is that PDF processing can freeze the UI, so it uses web workers to do processing in a background thread.
This script renders snowfall animation on a web page by generating a specified number of snowflake images and animating their movement down the page at different speeds and amplitudes. It initializes variables to track each snowflake's position, calculates screen dimensions, writes HTML elements for each snowflake, and calls an animation function that updates the snowflake positions on a timer to create the falling effect.
Paper.js is a vector graphics library that includes basic concepts like points, sizes, rectangles, and paths. It provides many constructors, syntactic sugar for math operations, and operator overloading. The library allows creating paths, circles, compound paths, hit testing, rasterizing, and more. It also supports events, layers, groups, symbols, styles, and PaperScript for scripting graphics in HTML canvases.
The document discusses dependent pair types (Σ-types), which allow the type of the second element of a pair to depend on the value of the first. It provides the formation rules, introduction and elimination rules, computation rules, and uniqueness principle for Σ-types. Examples of Σ-types are implemented in Idris and Scala using dependent functions and implicits.
This document provides an overview of core concepts for building user interfaces in iOS, including UIView, UIResponder, touch handling, and drawing. It explains the view hierarchy, how to add and arrange subviews, and how views handle touch events. It also covers low-level drawing using Core Graphics and Quartz 2D, including how to draw shapes, text, images and patterns.
Maximizing performance of 3 d user generated assets in unityWithTheBest
Maximizing performance of 3D user-generated assets in Unity
The document discusses optimizing 3D assets in Unity. It begins with an introduction and agenda, then covers optimization principles through examples from a trail renderer asset. The examples demonstrate reducing garbage collection by using queues instead of arrays, reusing components instead of creating new game objects, and comparing distances through dot products instead of taking square roots. Hands-on demonstrations are provided. Key takeaways are to profile for garbage collection, eliminate it by reusing objects when possible, and optimize comparisons.
Having fun with graphs, a short introduction to D3.jsMichael Hackstein
This talk is all about drawing on your webpage. We will have a short introduction to d3.js, a library to easily create SVGs in your webpage. Along the way we will render graphs using different layouting strategies. But what are the problems when displaying a graph? Just think of graphs having more vertices then you have pixels on your screen. Or what if you want a user to manupilate the graph and his changes being persistent? Michael will present his answers to this questions, ending up wit a GUI for a graph database.
The openFrameworks utils documentation provides information on various utility functions for date/time, lists, strings, threading, system tools, noise generation, screenshots, remote loading, and logging, allowing developers to easily access common operations like sorting/randomizing lists, splitting/joining strings, loading URLs asynchronously, and logging messages.
The HTML5 canvas element allows drawing directly onto the page via JavaScript. It provides pixel-level control for creating animations, games, charts, and more. The canvas is drawn upon by using a drawing context object and its methods like fillRect(), stroke(), arc(), and fillText(). Gradients, patterns, and images can also be rendered onto the canvas to create advanced graphics.
The ability to write shaders that can be used on any hardware vendor's graphics card that supports the OpenGL Shading Language. Each hardware vendor includes the GLSL compiler in their driver, thus allowing each vendor to create code optimized for their particular graphics card's architecture.
Neu und heiß! ARKit is heiß - ARKit2 ist heißerOrtwin Gentz
ARKit ist heiß, ARKit2 ist heißer! Ob animierte Tageszeitung aus dem Land der Zauberer oder nervenaufreibende Action beim Multi-User-Bowling - wir bringen es euch live auf die Bühne. In diesem Talk erfahrt ihr, was es wirklich Neues gibt in der Welt der Augmented Reality und wie man die neuen Themen wie Image Detection & Tracking, Save / Load WorldMaps als auch Multipeer-Connectivity effektiv in der eigenen App nutzen kann. Dabei arbeiten wir uns jeweils vom Code zum lebenden Beispiel vor, um euch sowohl einen Überblick als auch einen tiefen technischen Einblick in die Welt von ARKit bescheren zu können.
The document discusses object-oriented programming concepts in Objective-C such as classes, objects, properties, memory management using retain, release and autorelease, class and instance methods. It provides examples of declaring classes with interfaces and implementations, initializing objects, and accessing properties using dot syntax. Memory management is handled through retain counts, and autorelease pools are used to avoid memory leaks.
OpenGL® is the only cross-platform graphics API that enables developers of software for PC, workstation, and supercomputing hardware to create high- performance, visually-compelling graphics software applications, in markets such as CAD, content creation, energy, entertainment, game development, manufacturing, medical, and virtual reality.
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)François Sarradin
This document summarizes a presentation on monads explained to programmers. It discusses using monads like Try and Future in Scala to handle exceptions and asynchronous code in a functional way. It also discusses how monads allow separating technical concerns from business logic through composition. The presentation code examples demonstrate using for-comprehensions and flatMap with Try and Future to handle failures and combine asynchronous results in a declarative way.
This file contains all the practicals with output regarding GTU syllabus. so it will help to IT and Computer engineering students. It is really knowledgeable so refer these for computer graphics practicals.
- Tiled is an open-source editor for creating and editing tile maps for use in video games and other multimedia projects.
- LibGDX is a cross-platform game development framework that supports loading and rendering Tiled maps.
- Tiled maps can have multiple layers, tiles, and object layers for entities like the player.
- LibGDX provides classes for loading, rendering, and getting tile map data from Tiled maps to enable map navigation and collision detection in games.
- JavaScript has come a long way from its early days of form validation and image rollovers in 1995 to modern innovations like ES2015, Promises, async/await, and Web Assembly.
- Today, JavaScript features like classes, arrow functions, and template strings in ES2015 are widely adopted, and new standards like Promises, generators, and async programming have revolutionized asynchronous JavaScript.
- Emerging web platform technologies like Web Components, Service Workers, and CSS Paint enable new kinds of custom elements, offline/progressive web apps, and painting APIs, while proposals like decorators, value types, and module loading continue pushing the language forward.
Lecture 4 from the COSC 426 graduate class on Augmented Reality. Taught by Mark Billinghurst from the HIT Lab NZ at the University of Canterbury. August 1st 2012
PDF.js is a JavaScript library for rendering PDF files in the browser without using native code plugins. It works by parsing PDF files and converting the drawing commands into an intermediate representation, then executing those commands on a canvas to display the PDF content. One challenge is that PDF processing can freeze the UI, so it uses web workers to do processing in a background thread.
This script renders snowfall animation on a web page by generating a specified number of snowflake images and animating their movement down the page at different speeds and amplitudes. It initializes variables to track each snowflake's position, calculates screen dimensions, writes HTML elements for each snowflake, and calls an animation function that updates the snowflake positions on a timer to create the falling effect.
Paper.js is a vector graphics library that includes basic concepts like points, sizes, rectangles, and paths. It provides many constructors, syntactic sugar for math operations, and operator overloading. The library allows creating paths, circles, compound paths, hit testing, rasterizing, and more. It also supports events, layers, groups, symbols, styles, and PaperScript for scripting graphics in HTML canvases.
The document discusses dependent pair types (Σ-types), which allow the type of the second element of a pair to depend on the value of the first. It provides the formation rules, introduction and elimination rules, computation rules, and uniqueness principle for Σ-types. Examples of Σ-types are implemented in Idris and Scala using dependent functions and implicits.
This document provides an overview of core concepts for building user interfaces in iOS, including UIView, UIResponder, touch handling, and drawing. It explains the view hierarchy, how to add and arrange subviews, and how views handle touch events. It also covers low-level drawing using Core Graphics and Quartz 2D, including how to draw shapes, text, images and patterns.
Maximizing performance of 3 d user generated assets in unityWithTheBest
Maximizing performance of 3D user-generated assets in Unity
The document discusses optimizing 3D assets in Unity. It begins with an introduction and agenda, then covers optimization principles through examples from a trail renderer asset. The examples demonstrate reducing garbage collection by using queues instead of arrays, reusing components instead of creating new game objects, and comparing distances through dot products instead of taking square roots. Hands-on demonstrations are provided. Key takeaways are to profile for garbage collection, eliminate it by reusing objects when possible, and optimize comparisons.
Having fun with graphs, a short introduction to D3.jsMichael Hackstein
This talk is all about drawing on your webpage. We will have a short introduction to d3.js, a library to easily create SVGs in your webpage. Along the way we will render graphs using different layouting strategies. But what are the problems when displaying a graph? Just think of graphs having more vertices then you have pixels on your screen. Or what if you want a user to manupilate the graph and his changes being persistent? Michael will present his answers to this questions, ending up wit a GUI for a graph database.
The openFrameworks utils documentation provides information on various utility functions for date/time, lists, strings, threading, system tools, noise generation, screenshots, remote loading, and logging, allowing developers to easily access common operations like sorting/randomizing lists, splitting/joining strings, loading URLs asynchronously, and logging messages.
The HTML5 canvas element allows drawing directly onto the page via JavaScript. It provides pixel-level control for creating animations, games, charts, and more. The canvas is drawn upon by using a drawing context object and its methods like fillRect(), stroke(), arc(), and fillText(). Gradients, patterns, and images can also be rendered onto the canvas to create advanced graphics.
The ability to write shaders that can be used on any hardware vendor's graphics card that supports the OpenGL Shading Language. Each hardware vendor includes the GLSL compiler in their driver, thus allowing each vendor to create code optimized for their particular graphics card's architecture.
Neu und heiß! ARKit is heiß - ARKit2 ist heißerOrtwin Gentz
ARKit ist heiß, ARKit2 ist heißer! Ob animierte Tageszeitung aus dem Land der Zauberer oder nervenaufreibende Action beim Multi-User-Bowling - wir bringen es euch live auf die Bühne. In diesem Talk erfahrt ihr, was es wirklich Neues gibt in der Welt der Augmented Reality und wie man die neuen Themen wie Image Detection & Tracking, Save / Load WorldMaps als auch Multipeer-Connectivity effektiv in der eigenen App nutzen kann. Dabei arbeiten wir uns jeweils vom Code zum lebenden Beispiel vor, um euch sowohl einen Überblick als auch einen tiefen technischen Einblick in die Welt von ARKit bescheren zu können.
The document discusses object-oriented programming concepts in Objective-C such as classes, objects, properties, memory management using retain, release and autorelease, class and instance methods. It provides examples of declaring classes with interfaces and implementations, initializing objects, and accessing properties using dot syntax. Memory management is handled through retain counts, and autorelease pools are used to avoid memory leaks.
OpenGL® is the only cross-platform graphics API that enables developers of software for PC, workstation, and supercomputing hardware to create high- performance, visually-compelling graphics software applications, in markets such as CAD, content creation, energy, entertainment, game development, manufacturing, medical, and virtual reality.
FLATMAP ZAT SHIT : les monades expliquées aux geeks (Devoxx France 2013)François Sarradin
This document summarizes a presentation on monads explained to programmers. It discusses using monads like Try and Future in Scala to handle exceptions and asynchronous code in a functional way. It also discusses how monads allow separating technical concerns from business logic through composition. The presentation code examples demonstrate using for-comprehensions and flatMap with Try and Future to handle failures and combine asynchronous results in a declarative way.
This file contains all the practicals with output regarding GTU syllabus. so it will help to IT and Computer engineering students. It is really knowledgeable so refer these for computer graphics practicals.
- Tiled is an open-source editor for creating and editing tile maps for use in video games and other multimedia projects.
- LibGDX is a cross-platform game development framework that supports loading and rendering Tiled maps.
- Tiled maps can have multiple layers, tiles, and object layers for entities like the player.
- LibGDX provides classes for loading, rendering, and getting tile map data from Tiled maps to enable map navigation and collision detection in games.
- JavaScript has come a long way from its early days of form validation and image rollovers in 1995 to modern innovations like ES2015, Promises, async/await, and Web Assembly.
- Today, JavaScript features like classes, arrow functions, and template strings in ES2015 are widely adopted, and new standards like Promises, generators, and async programming have revolutionized asynchronous JavaScript.
- Emerging web platform technologies like Web Components, Service Workers, and CSS Paint enable new kinds of custom elements, offline/progressive web apps, and painting APIs, while proposals like decorators, value types, and module loading continue pushing the language forward.
Lecture 4 from the COSC 426 graduate class on Augmented Reality. Taught by Mark Billinghurst from the HIT Lab NZ at the University of Canterbury. August 1st 2012
Augmented Reality With FlarToolkit and Papervision3DRoman Protsyk
This document discusses augmented reality and provides an example of creating an augmented reality demo using Flex, FlarToolkit, and Papervision3D. It explains what augmented reality is, provides examples, and discusses how FlarToolkit works and the steps to create a sample AR application that detects markers and renders 3D objects.
Leaving Flatland: getting started with WebGLgerbille
WebGL is a JavaScript API for rendering interactive 3D graphics within any compatible web browser without the use of plug-ins. It can be used for data visualization, creative coding, 3D modeling, games, and more. WebGL works by using JavaScript to interface with the GPU through WebGL APIs to run GLSL shaders that render 3D scenes. To get started, one needs to choose a WebGL library like Three.js, add a <canvas> element, and get the WebGL context. Sample code is provided to render a 3D model by loading geometry, adding lights and materials, and animating the scene render.
This document provides an example of using Java 3D to create a 3D checkers board scene. It includes code to:
1) Create a windowed Java application with a Canvas3D panel to display the 3D scene
2) Build the 3D scene graph with objects like a checkered floor, floating sphere, lights and sky background
3) Add viewpoint controls to allow orbiting around the scene
This document outlines an agenda for introducing Recoil, a state management library for React. It will include meeting the audience, discussing state management options, hearing from a project owner, learning Recoil basics through a live demo of building a map application, and answering questions. Key features that will be demonstrated include sharing local component state through Recoil atoms, derived data with selectors, asynchronous data, and state persistence. The presenter argues that Recoil is worth considering if an application requires more than Context can handle and is not afraid of experimental APIs.
This document provides an introduction to creating 3D scenes using the three.js library. It discusses the key components of a 3D scene: the light source, camera, and renderer. Common light sources like ambient, point, and directional lights are described. Perspective and orthographic cameras are covered. The renderer draws the scene. Examples are provided for setting up a basic scene with these components and adding objects, animating objects, selecting objects using raycasting, and controlling the camera. Advantages of 3D web development using three.js include being browser-based and able to integrate with other web technologies.
The document discusses building 2D and 3D games with Ruby using low-level APIs. It covers topics like building 2D games with Ruby SDL, building 3D games with Ruby OpenGL, and whether Ruby is a legitimate player in the gaming space. Examples provided include sample code for sprites, events, and extensions to interface with C libraries for graphics and game development.
The document discusses building 2D and 3D games with Ruby using low-level APIs. It covers topics like building 2D games with Ruby SDL, building 3D games with Ruby OpenGL, and whether Ruby is a legitimate player in the gaming space. Examples provided include sample code for sprites, events, and extensions to interface with C libraries for graphics and game development.
This document summarizes a JavaScript slider library called Swiper. Swiper is a mobile touch slider and framework that uses hardware accelerated transitions. It is open source under the MIT license and was last updated in December 2018. The library provides slider functionality that works across devices and supports touch interactions.
This document is the license and introduction for Swiper, an open source JavaScript library for mobile touch sliders and frameworks. Swiper is a modern mobile touch slider with hardware accelerated transitions. It is released under the MIT license and was last updated in December 2018. The library provides touch functionality for sliders and frameworks on mobile devices.
WebGL and COLLADA were discussed as technologies for 3D rendering and asset interchange on the web. The presentation covered the history and capabilities of both standards. It also described approaches for loading COLLADA assets into WebGL, such as preprocessing COLLADA into JSON or loading XML directly and parsing it with JavaScript. Optimizing COLLADA assets for WebGL rendering through techniques like quantization and compression was also mentioned.
By now you have heard about Flash Augmented Reality and how it is taking the Flash Development community by storm! Whether you are looking for how to get started, how to improve your own experiments or have a client who desperately needs AR on their site, this session is for you.
In this keynote I cover getting up and running as well as the ideal workflow for testing/deploying your creation. I also cover the basics then quickly move into how to build a FLAR Emulator for easy testing/debugging as well as general usability/performance issues. Finally we will look at my own experiments with AR, how they were built and highlight some of the best uses of Flash AR today.
The goal of this presentation is to teach you how to build a solid reusable foundation for all of your Flash AR projects which will allow you to quickly prototype your ideas. All code covered in this session is open source and free to use. Documentation on how it works will also be handed out as well.
DESIGNING A PERSISTENCE FRAMEWORK WITH PATTERNS.pptAntoJoseph36
The document discusses designing a persistence framework using patterns. It describes persistent objects that survive process termination and storage mechanisms like object and relational databases. A persistence framework provides functions to store/retrieve objects and commit/rollback transactions. Key concepts covered include mapping objects to tables, object identity, materialization/dematerialization, caches, and transactions. Common patterns used in persistence frameworks are also described, such as representing objects as tables, the database mapper pattern, template method for caching, and the state pattern for transaction management.
Following are the changes mentioned in bold in order to obtain the r.pdfanithareadymade
Following are the changes mentioned in bold in order to obtain the required result and stop
scrolling in the background.
#include \"SDL/SDL.h\"
#include
//The attributes of the screen can be defined as follows
const int SCN_WIDTH = 640;
const int SCN_HEIGHT = 480;
const int SCN_BPP = 32;
//BPP defines bits per pixel
SDL_Surface* Background = NULL;
SDL_Surface* SpriteImage = NULL;
SDL_Surface* Backbuffer = NULL;
int SpriteFrame = 0;
int FrameCounter = 0;
const int MaxSpriteFrame = 12;
const int FrameDelay = 2;
int BackgroundX = 0;
SDL_Surface* LoadImage(char* fileName);
bool LoadFiles();
void FreeFiles();
void DrawImage(SDL_Surface* image, SDL_Surface* destSurface, int x, int y);
void DrawImageFrame(SDL_Surface* image, SDL_Surface* destSurface, int x, int y, int width,
int height, int frame);
bool ProgramIsRunning();
int main(int argc, char* args[])
{
if(SDL_Init(SDL_INIT_EVERYTHING) < 0)
{
printf(\"Failed to initialize SDL!\ \");
return 0;
}
Backbuffer = SDL_SetVideoMode(800, 600, 32, SDL_SWSURFACE);
SDL_WM_SetCaption(\"Image Animation\", NULL);
if(!LoadFiles())
{
printf(\"Failed to load all files!\ \");
FreeFiles();
SDL_Quit();
return 0;
}
while(ProgramIsRunning())
{
//Update\'s the sprites frame
FrameCounter++;
if(FrameCounter > FrameDelay)
{
FrameCounter = 0;
SpriteFrame++;
}
if(SpriteFrame > MaxSpriteFrame)
SpriteFrame = 0;
//Background scrolling can be removed from this position
//Render the scene
DrawImage(Background,Backbuffer, BackgroundX, 0);
DrawImage(Background,Backbuffer, BackgroundX+800, 0);
DrawImageFrame(SpriteImage, Backbuffer, 350,250, 150, 120, SpriteFrame);
SDL_Delay(20);
SDL_Flip(Backbuffer);
}
FreeFiles();
SDL_Quit();
return 0;
}
SDL_Surface* LoadImage(char* fileName)
{
SDL_Surface* imageLoaded = NULL;
SDL_Surface* processedImage = NULL;
imageLoaded = SDL_LoadBMP(fileName);
if(imageLoaded != NULL)
{
processedImage = SDL_DisplayFormat(imageLoaded);
SDL_FreeSurface(imageLoaded);
if(processedImage != NULL)
{
//Here we map the color key
Uint32 colorKey = SDL_MapRGB(processedImage->format, 0, 0xFF, 0xFF);
//Now, set all the pixels of color R 0,G 0*FF,B 0*FF to be transparent
SDL_SetColorKey(processedImage, SDL_SRCCOLORKEY, colorKey);
}
}
return processedImage;
}
bool LoadFiles()
{
Background = LoadImage(\"graphics/background.bmp\");
if(Background == NULL)
return false;
SpriteImage = LoadImage(\"graphics/bat.bmp\");
//The file should be preloaded and linked with the required libraries in SDL
if(SpriteImage == NULL)
return false;
else
return true;
}
void FreeFiles()
{
SDL_FreeSurface(Background);
SDL_FreeSurface(SpriteImage);
}
void DrawImage(SDL_Surface* image, SDL_Surface* destSurface, int x, int y)
//A temporary rectangle is used to hold the offsets
{
SDL_Rect destRect;
//Giving the offsets to the rectangle
destRect.x = x;
destRect.y = y;
//Blit the surface
SDL_BlitSurface(image, NULL, destSurface, &destRect);
}
//Here, we need to start the main function:
int main(int argc,char** args)
//Now, initialize all SDL subsystems
if .
Introduction to open gl in android droidcon - slidestamillarasan
This document provides an introduction and overview of OpenGL ES 2.0 for Android. It discusses setting up a OpenGL view, drawing basic shapes, animating objects, and applying textures. The key steps covered are initializing a GLSurfaceView, creating and linking shader programs, defining and drawing vertex data, setting up the model-view-projection matrix, and mapping texture coordinates. The goal is to provide everything needed to get started with basic 2D OpenGL graphics and animation on Android.
Presented at FITC Toronto 2016
See details at www.fitc.ca
AngularJS was originally created in 2009 as an end-to-end solution for web designers wanting to build simple web apps. Over the last 6 years it has evolved into a component based MVC framework targeted at JavaScript developers. To maintain backward compatibility, Angular has had to hold onto many deprecated concepts. This has caused some of Angular’s APIs to be complex and easy to misuse. Angular 2 is a complete rewrite of Angular 1 which eliminates the outdated concepts and takes full advantage of modern web standards like ES6, TypeScript, and Web Components.
In this session you’ll learn which Angular 1 features to avoid and how to write an Angular 1 app that will be easy to migrate into Angular 2. We’ll go through the process of refactoring an Angular 1 app to prep it for migration. Then Rob will demonstrate how to incrementally migrate to Angular 2. You’ll come away from this session with a better understanding of what Angular 2 has to offer and how to start taking advantage of it.
Objective
To make the migration from Angular 1 to Angular 2 as painless as possible
Target Audience
Anyone using Angular 1 or interested in learning Angular 2.
Assumed Audience Knowledge
Some experience with JavaScript and Angular 1
Five Things Audience Members Will Learn
How to write an Angular 1 app that will be easy to migrate
Using TypeScript, ES6 modules, and the component router with Angular 1
The benefits of Angular 2
How to run Angular 1 and 2 in the same app
How to migrate an Angular 1 app to Angular 2
1. Use nonatomic properties for primitive types like floats to avoid locking.
2. Use CCArray instead of NSMutableArray for better performance in cocos2d. Iterate arrays using CC_ARRAY_FOREACH.
3. Use index access instead of indexOfObject to improve performance of lookups in for loops.
WebGL is a JavaScript API for rendering interactive 3D graphics and 2D graphics within any compatible web browser without the use of plug-ins. It can be used for data visualization, creative coding, art, 3D design environments, music videos, mathematical function graphing, 3D modeling, texture creation, physics simulations, and more. WebGL works by using JavaScript to interface with the GPU through WebGL API calls. Common libraries like Three.js simplify the use of WebGL. The basics of a WebGL app include setting up a 3D scene, camera, and rendering loop. Sample code is provided to load a 3D model and texture and allow interactive rotation. Resources listed for learning more include tutorials on Phil
Similar to Sceneform SDK на практиці - UA Mobile 2019 (20)
2. Get started
Use cases:
1. Drawing 3D
scene
2. Item 1 + SLAM
(require
support ARCore)
Requirements:
1.Android SDK
version >=24
2.Java 8
3.*Sceneform Gradle
Plugin
4.*Google Sceneform
Tools for Android
Studio
5.*com.google.ar.sc
eneform:core
Support:
1. Shapes (sphere,
cylinder, cube)
2. 2D Android View
3. 3D models
(OBJ/FBX/GLTF/G
LB)
4. *Android
Property
animations or
FBX 2016/17+)
3. Scene and Nodes
Scene
Sun Camera AnchorNode AugmentedFaceNode
SkeletonNode
Special nodes
TransformableNode
4. World Vs Local Coord
World Coord.
Anchor A Coord.
(Local Coord.)
Anchor B Coord.
(Local Coord.)
12. Sceneform Material (I)
A material defines the visual appearance of a surface.
To completely describe and render a surface, a material
provides the following information:
● Material model
● Set of use-controllable named parameters
● Raster state (blending mode, backface culling,
etc.)
● Vertex shader code
● Fragment shader code
material {
// material properties
}
vertex {
// vertex shader, optional
}
fragment {
// fragment shader
}
15. Filament
Filament is a real-time physically
based rendering engine for Android,
iOS, Linux, macOS, Windows, and WebGL.
It is designed to be as small as
possible and as efficient as possible
on Android.
● OpenGL 4.1+ for Linux, macOS and Windows
● OpenGL ES 3.0+ for Android and iOS
● Metal for macOS and iOS
● Vulkan 1.0 for Android, Linux, macOS and iOS (with
MoltenVk), and Windows
● WebGL 2.0 for all platforms
23. Image Recognition
● Up to 1000 reference images.
● Up to 20 images simultaneously in the environment, but it cannot
track multiple instances of the same image.
● The physical image in the environment must be at least 15cm x 15cm
and must be flat
● Once tracked, ARCore provides estimates for position, orientation,
and physical size. These estimates are continuously refined as
ARCore gathers more data.
● ARCore cannot track a moving image, but it can resume tracking
that image after it stops moving.
● All tracking happens on the device, so no internet connection is
required. Reference images can be updated on-device or over the
network without requiring an app update.