Providers¶
Contents
Providers are abstractions of the provider party of the provider/consumer/user triangle and they are the very core of this library. There is no reason for you to instantiate them manually. You only should specify them in the Config and access members of their instances available in the LoginResult returned by the authomatic.login() function.
Some provider types accept additional keyword arguments in their constructor which you can pass to them through the authomatic.login() function’s keyword arguments or through the Config like this:
Note
Keyword arguments passed through authomatic.login() will override the values set in Config.
CONFIG = {
'facebook': {
'class_': oauth2.Facebook, # Subclass of AuthorizationProvider
# AuthorizationProvider specific keyword arguments:
'short_name': 1,
'consumer_key': '###################',
'consumer_secret': '###################',
# oauth2.OAuth2 specific keyword arguments:
'scope': ['user_about_me', 'email']
},
'openid': {
'class_': openid.OpenID, # Subclass of AuthenticationProvider
# AuthenticationProvider specific keyword arguments:
'identifier_param': 'claimed_id',
# openid.OpenID specific keyword arguments:
'use_realm': True,
'realm_body': 'OpenID Realm.',
'realm_param': 'r',
'xrds_param': 'x',
'sreg': ['nickname', 'email'],
'sreg_required': ['email'],
'ax': ['http://axschema.org/contact/email', 'http://axschema.org/namePerson'],
'ax_required': ['http://axschema.org/contact/email'],
'pape': ['http://schemas.openid.net/pape/policies/2007/06/multi-factor']
},
}
Additional keyword arguments by provider type:
| Provider Type | Argument Name | Required | |
|---|---|---|---|
| OAuth2 | consumer_key | yes | |
| consumer_secret | yes | ||
| short_name | yes | ||
| scope | |||
| offline | |||
| user_authorization_params | |||
| access_token_params | |||
| popup | |||
| OAuth1 | consumer_key | yes | |
| consumer_secret | yes | ||
| short_name | yes | ||
| request_token_params | |||
| user_authorization_params | |||
| access_token_params | |||
| popup | |||
| OpenID | identifier_param | ||
| use_realm | |||
| realm_body | |||
| realm_param | |||
| xrds_param | |||
| sreg | |||
| sreg_required | |||
| ax | |||
| ax_required | |||
| pape | |||
| popup | |||
| GAEOpenID | identifier_param | ||
| popup |
Available provider classes:
OAuth 2.0 Providers¶
Providers which implement the OAuth 2.0 protocol.
| OAuth2(*args, **kwargs) | Base class for OAuth 2.0 providers. |
| Amazon(*args, **kwargs) | Amazon OAuth 2.0 provider. |
| Behance(*args, **kwargs) | Behance OAuth 2.0 provider. |
| Bitly(*args, **kwargs) | Bitly OAuth 2.0 provider. |
| Cosm(*args, **kwargs) | Cosm OAuth 2.0 provider. |
| DeviantART(*args, **kwargs) | DeviantART OAuth 2.0 provider. |
| Eventbrite(*args, **kwargs) | Eventbrite OAuth 2.0 provider. |
| Facebook(*args, **kwargs) | Facebook OAuth 2.0 provider. |
| Foursquare(*args, **kwargs) | Foursquare OAuth 2.0 provider. |
| GitHub(*args, **kwargs) | GitHub OAuth 2.0 provider. |
| Google(*args, **kwargs) | Google OAuth 2.0 provider. |
| LinkedIn(*args, **kwargs) | Linked In OAuth 2.0 provider. |
| PayPal(*args, **kwargs) | PayPal OAuth 2.0 provider. |
| Reddit(*args, **kwargs) | Reddit OAuth 2.0 provider. |
| Viadeo(*args, **kwargs) | Viadeo OAuth 2.0 provider. |
| VK(*args, **kwargs) | VK.com OAuth 2.0 provider. |
| WindowsLive(*args, **kwargs) | Windows Live OAuth 2.0 provider. |
| Yammer(*args, **kwargs) | Yammer OAuth 2.0 provider. |
| Yandex(*args, **kwargs) | Yandex OAuth 2.0 provider. |
- class authomatic.providers.oauth2.OAuth2(*args, **kwargs)[source]¶
Base class for OAuth 2.0 providers.
Accepts additional keyword arguments:
Parameters: - scope (list) – List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- user_info_scope = []¶
A scope preset to get most of the user info. Use it in the Config like {'scope': oauth2.Facebook.user_info_scope}.
- classmethod create_request_elements(request_type, credentials, url, method='GET', params=None, headers=None, body='', secret=None, redirect_uri='', scope='', csrf='')[source]¶
Creates OAuth 2.0 request elements.
- refresh_credentials(credentials)[source]¶
Refreshes Credentials if it gives sense.
Parameters: credentials – Credentials to be refreshed. Returns: Response.
- class authomatic.providers.oauth2.Amazon(*args, **kwargs)[source]¶
Amazon OAuth 2.0 provider.
Thanks to Ghufran Syed.
- Dashboard: https://developer.amazon.com/lwa/sp/overview.html
- Docs: https://developer.amazon.com/public/apis/engage/login-with-amazon/docs/conceptual_overview.html
- API reference: https://developer.amazon.com/public/apis
Note
Amazon only accepts redirect_uri with https schema, Therefore the login handler must also be accessible through https.
Supported User properties:
- id
- name
- postal_code
Unsupported User properties:
- birth_date
- city
- country
- first_name
- gender
- last_name
- link
- locale
- nickname
- phone
- picture
- timezone
- username
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.Behance(*args, **kwargs)[source]¶
Behance OAuth 2.0 provider.
Note
Behance doesn’t support third party authorization anymore, which renders this class pretty much useless.
- Dashboard: http://www.behance.net/dev/apps
- Docs: http://www.behance.net/dev/authentication
- API reference: http://www.behance.net/dev/api/endpoints/
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.Bitly(*args, **kwargs)[source]¶
Bitly OAuth 2.0 provider.
Warning
This provider doesn’t support CSRF protection!
- Dashboard: https://bitly.com/a/oauth_apps
- Docs: http://dev.bitly.com/authentication.html
- API reference: http://dev.bitly.com/api.html
Supported User properties:
- id
- link
- name
- picture
- username
Unsupported User properties:
- birth_date
- city
- country
- first_name
- gender
- last_name
- locale
- nickname
- phone
- postal_code
- timezone
- class authomatic.providers.oauth2.Cosm(*args, **kwargs)[source]¶
Cosm OAuth 2.0 provider.
Note
Cosm doesn’t provide any user info URL.
- Dashboard: https://cosm.com/users/{your_username}/apps
- Docs: https://cosm.com/docs/
- API reference: https://cosm.com/docs/v2/
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.DeviantART(*args, **kwargs)[source]¶
DeviantART OAuth 2.0 provider.
- Dashboard: https://www.deviantart.com/settings/myapps
- Docs: https://www.deviantart.com/developers/authentication
- API reference: http://www.deviantart.com/developers/oauth2
Supported User properties:
- name
- picture
- username
Unsupported User properties:
- birth_date
- city
- country
- first_name
- gender
- id
- last_name
- link
- locale
- nickname
- phone
- postal_code
- timezone
- class authomatic.providers.oauth2.Eventbrite(*args, **kwargs)[source]¶
Eventbrite OAuth 2.0 provider.
Thanks to Paul Brown.
- Dashboard: http://www.eventbrite.com/myaccount/apps/
- Docs: https://developer.eventbrite.com/docs/auth/
- API: http://developer.eventbrite.com/docs/
Supported User properties:
- first_name
- id
- last_name
- name
Unsupported User properties:
- birth_date
- city
- country
- gender
- link
- locale
- nickname
- phone
- picture
- postal_code
- timezone
- username
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.Facebook(*args, **kwargs)[source]¶
Facebook OAuth 2.0 provider.
- Dashboard: https://developers.facebook.com/apps
- Docs: http://developers.facebook.com/docs/howtos/login/server-side-login/
- API reference: http://developers.facebook.com/docs/reference/api/
- API explorer: http://developers.facebook.com/tools/explorer
Supported User properties:
- birth_date
- city
- country
- first_name
- gender
- id
- last_name
- link
- locale
- location
- name
- picture
- timezone
Unsupported User properties:
- nickname
- phone
- postal_code
- username
- class authomatic.providers.oauth2.Foursquare(*args, **kwargs)[source]¶
Foursquare OAuth 2.0 provider.
- Dashboard: https://foursquare.com/developers/apps
- Docs: https://developer.foursquare.com/overview/auth.html
- API reference: https://developer.foursquare.com/docs/
Note
Foursquare requires a version parameter in each request. The default value is v=20140501. You can override the version in the params parameter of the Authomatic.access() method. See https://developer.foursquare.com/overview/versioning
Supported User properties:
- city
- country
- first_name
- gender
- id
- last_name
- location
- name
- phone
- picture
Unsupported User properties:
- birth_date
- link
- locale
- nickname
- postal_code
- timezone
- username
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.GitHub(*args, **kwargs)[source]¶
GitHub OAuth 2.0 provider.
- Dashboard: https://github.com/settings/developers
- Docs: http://developer.github.com/v3/#authentication
- API reference: http://developer.github.com/v3/
Note
GitHub API documentation sais:
all API requests MUST include a valid User-Agent header.You can apply a default User-Agent header for all API calls in the config like this:
CONFIG = { 'github': { 'class_': oauth2.GitHub, 'consumer_key': '#####', 'consumer_secret': '#####', 'access_headers': {'User-Agent': 'Awesome-Octocat-App'}, } }
Supported User properties:
- id
- link
- location
- name
- picture
- username
Unsupported User properties:
- birth_date
- city
- country
- first_name
- gender
- last_name
- locale
- nickname
- phone
- postal_code
- timezone
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.Google(*args, **kwargs)[source]¶
Google OAuth 2.0 provider.
- Dashboard: https://console.developers.google.com/project
- Docs: https://developers.google.com/accounts/docs/OAuth2
- API reference: https://developers.google.com/gdata/docs/directory
- API explorer: https://developers.google.com/oauthplayground/
Supported User properties:
- first_name
- gender
- id
- last_name
- link
- locale
- name
- picture
Unsupported User properties:
- birth_date
- city
- country
- nickname
- phone
- postal_code
- timezone
- username
Note
To get the user info, you need to activate the Google+ API in the APIs & auth >> APIs section of the`Google Developers Console <https://console.developers.google.com/project>`__.
- class authomatic.providers.oauth2.LinkedIn(*args, **kwargs)[source]¶
Linked In OAuth 2.0 provider.
Note
Doesn’t support access token refreshment.
- Dashboard: https://www.linkedin.com/secure/developer
- Docs: http://developer.linkedin.com/documents/authentication
- API reference: http://developer.linkedin.com/rest
Supported User properties:
- country
- first_name
- id
- last_name
- link
- location
- name
- picture
Unsupported User properties:
- birth_date
- city
- gender
- locale
- nickname
- phone
- postal_code
- timezone
- username
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.PayPal(*args, **kwargs)[source]¶
PayPal OAuth 2.0 provider.
- Dashboard: https://developer.paypal.com/webapps/developer/applications
- Docs: https://developer.paypal.com/webapps/developer/docs/integration/direct/make-your-first-call/
- API reference: https://developer.paypal.com/webapps/developer/docs/api/
Note
Paypal doesn’t redirect the user to authorize your app! It grants you an access token based on your app’s key and secret instead.
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.Reddit(*args, **kwargs)[source]¶
Reddit OAuth 2.0 provider.
Note
Currently credentials refreshment returns {"error": "invalid_request"}.
- Dashboard: https://ssl.reddit.com/prefs/apps
- Docs: https://github.com/reddit/reddit/wiki/OAuth2
- API reference: http://www.reddit.com/dev/api
Note
According to Reddit API docs, you have to include a User-Agent header in each API call.
You can apply a default User-Agent header for all API calls in the config like this:
CONFIG = { 'reddit': { 'class_': oauth2.Reddit, 'consumer_key': '#####', 'consumer_secret': '#####', 'access_headers': {'User-Agent': "Andy Pipkin's App"}, } }
Supported User properties:
- id
- username
Unsupported User properties:
- birth_date
- country
- city
- first_name
- gender
- last_name
- link
- locale
- location
- name
- nickname
- phone
- picture
- postal_code
- timezone
- class authomatic.providers.oauth2.Viadeo(*args, **kwargs)[source]¶
Viadeo OAuth 2.0 provider.
Note
As stated in the Viadeo documentation:
Viadeo restrains access to its API. They are now exclusively reserved for its strategic partners.- Dashboard: http://dev.viadeo.com/dashboard/
- Docs: http://dev.viadeo.com/documentation/authentication/oauth-authentication/
- API reference: http://dev.viadeo.com/documentation/
Note
Viadeo doesn’t support credentials refreshment. As stated in their docs: “The access token has an infinite time to live.”
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.VK(*args, **kwargs)[source]¶
VK.com OAuth 2.0 provider.
- Dashboard: http://vk.com/apps?act=manage
- Docs: http://vk.com/developers.php?oid=-17680044&p=Authorizing_Sites
- API reference: http://vk.com/developers.php?oid=-17680044&p=API_Method_Description
Note
VK uses a bitmask scope! Use it like this:
CONFIG = { 'vk': { 'class_': oauth2.VK, 'consumer_key': '#####', 'consumer_secret': '#####', 'id': authomatic.provider_id(), 'scope': ['1024'] # Always a single item. } }
Supported User properties:
- birth_date
- city
- country
- first_name
- gender
- id
- last_name
- location
- name
- picture
- timezone
Unsupported User properties:
- link
- locale
- nickname
- phone
- postal_code
- username
- class authomatic.providers.oauth2.WindowsLive(*args, **kwargs)[source]¶
Windows Live OAuth 2.0 provider.
- Dashboard: https://account.live.com/developers/applications
- Docs: http://msdn.microsoft.com/en-us/library/hh243647.aspx
- API explorer: http://isdk.dev.live.com/?mkt=en-us
Supported User properties:
- first_name
- id
- last_name
- link
- locale
- name
- picture
Unsupported User properties:
- birth_date
- city
- country
- gender
- nickname
- location
- phone
- postal_code
- timezone
- username
- class authomatic.providers.oauth2.Yammer(*args, **kwargs)[source]¶
Yammer OAuth 2.0 provider.
- Dashboard: https://www.yammer.com/client_applications
- Docs: https://developer.yammer.com/authentication/
- API reference: https://developer.yammer.com/restapi/
Supported User properties:
- birth_date
- city
- country
- first_name
- id
- last_name
- link
- locale
- location
- name
- phone
- picture
- timezone
- username
Unsupported User properties:
- gender
- nickname
- postal_code
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
- class authomatic.providers.oauth2.Yandex(*args, **kwargs)[source]¶
Yandex OAuth 2.0 provider.
- Dashboard: https://oauth.yandex.com/client/my
- Docs: http://api.yandex.com/oauth/doc/dg/reference/obtain-access-token.xml
- API reference:
Supported User properties:
- id
- name
- username
Unsupported User properties:
- birth_date
- city
- country
- first_name
- gender
- last_name
- link
- locale
- location
- nickname
- phone
- picture
- postal_code
- timezone
Accepts additional keyword arguments:
Parameters: - scope (list) –
List of strings specifying requested permissions as described in the OAuth 2.0 spec.
- offline (bool) – If True the provider will be set up to request an offline access token. default is False.
As well as those inherited from AuthorizationProvider constructor.
OAuth 1.0a Providers¶
Providers which implement the OAuth 1.0a protocol.
| OAuth1(*args, **kwargs) | Base class for OAuth 1.0a providers. |
| Bitbucket(*args, **kwargs) | Bitbucket OAuth 1.0a provider. |
| Flickr(*args, **kwargs) | Flickr OAuth 1.0a provider. |
| Meetup(*args, **kwargs) | Meetup OAuth 1.0a provider. |
| Plurk(*args, **kwargs) | Plurk OAuth 1.0a provider. |
| Twitter(*args, **kwargs) | Twitter OAuth 1.0a provider. |
| Tumblr(*args, **kwargs) | Tumblr OAuth 1.0a provider. |
| UbuntuOne(*args, **kwargs) | Ubuntu One OAuth 1.0a provider. |
| Vimeo(*args, **kwargs) | Vimeo OAuth 1.0a provider. |
| Xero(*args, **kwargs) | Xero OAuth 1.0a provider. |
| Xing(*args, **kwargs) | Xing OAuth 1.0a provider. |
| Yahoo(*args, **kwargs) | Yahoo OAuth 1.0a provider. |
- class authomatic.providers.oauth1.OAuth1(*args, **kwargs)[source]¶
Base class for OAuth 1.0a providers.
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- request_token_url[source]¶
str URL where we can get the OAuth 1.0a request token. see http://oauth.net/core/1.0a/#auth_step1.
- class authomatic.providers.oauth1.Bitbucket(*args, **kwargs)[source]¶
Bitbucket OAuth 1.0a provider.
- Dashboard: https://bitbucket.org/account/user/peterhudec/api
- Docs: https://confluence.atlassian.com/display/BITBUCKET/oauth+Endpoint
- API reference: https://confluence.atlassian.com/display/BITBUCKET/Using+the+Bitbucket+REST+APIs
Supported User properties:
- first_name
- id
- last_name
- link
- name
- picture
- username
Unsupported User properties:
- birth_date
- city
- country
- gender
- locale
- location
- nickname
- phone
- postal_code
- timezone
Note
To get the full user info, you need to select both the Account Read and the Repositories Read permission in the Bitbucket application edit form.
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Flickr(*args, **kwargs)[source]¶
Flickr OAuth 1.0a provider.
- Dashboard: https://www.flickr.com/services/apps/
- Docs: https://www.flickr.com/services/api/auth.oauth.html
- API reference: https://www.flickr.com/services/api/
Supported User properties:
- id
- name
- username
Unsupported User properties:
- birth_date
- city
- country
- first_name
- gender
- last_name
- link
- locale
- location
- nickname
- phone
- picture
- postal_code
- timezone
Note
If you encounter the “Oops! Flickr doesn’t recognise the permission set.” message, you need to add the perms=read or perms=write parameter to the user authorization request. You can do it by adding the user_authorization_params key to the Config:
CONFIG = { 'flickr': { 'class_': oauth1.Flickr, 'consumer_key': '##########', 'consumer_secret': '##########', 'user_authorization_params': dict(perms='read'), }, }
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Meetup(*args, **kwargs)[source]¶
Meetup OAuth 1.0a provider.
Note
Meetup also supports OAuth 2.0 but you need the user ID to update the user info, which they don’t provide in the OAuth 2.0 access token response.
- Dashboard: http://www.meetup.com/meetup_api/oauth_consumers/
- Docs: http://www.meetup.com/meetup_api/auth/#oauth
- API: http://www.meetup.com/meetup_api/docs/
Supported User properties:
- city
- country
- id
- link
- locale
- location
- name
- picture
Unsupported User properties:
- birth_date
- first_name
- gender
- last_name
- nickname
- phone
- postal_code
- timezone
- username
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Plurk(*args, **kwargs)[source]¶
Plurk OAuth 1.0a provider.
- Dashboard: http://www.plurk.com/PlurkApp/
- Docs:
- API: http://www.plurk.com/API
- API explorer: http://www.plurk.com/OAuth/test/
Supported User properties:
- birth_date
- city
- country
- gender
- id
- link
- locale
- location
- name
- nickname
- picture
- timezone
- username
Unsupported User properties:
- first_name
- last_name
- phone
- postal_code
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Twitter(*args, **kwargs)[source]¶
Twitter OAuth 1.0a provider.
- Dashboard: https://dev.twitter.com/apps
- Docs: https://dev.twitter.com/docs
- API reference: https://dev.twitter.com/docs/api
Supported User properties:
- id
- link
- locale
- location
- name
- picture
- username
Unsupported User properties:
- birth_date
- city
- country
- gender
- first_name
- last_name
- nickname
- phone
- postal_code
- timezone
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Tumblr(*args, **kwargs)[source]¶
Tumblr OAuth 1.0a provider.
- Dashboard: http://www.tumblr.com/oauth/apps
- Docs: http://www.tumblr.com/docs/en/api/v2#auth
- API reference: http://www.tumblr.com/docs/en/api/v2
Supported User properties:
- id
- name
- username
Unsupported User properties:
- birth_date
- city
- country
- gender
- first_name
- last_name
- link
- locale
- location
- nickname
- phone
- picture
- postal_code
- timezone
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.UbuntuOne(*args, **kwargs)[source]¶
Ubuntu One OAuth 1.0a provider.
Note
The UbuntuOne service has been shut down.
Warning
Uses the PLAINTEXT Signature method!
- Dashboard: https://one.ubuntu.com/developer/account_admin/auth/web
- Docs: https://one.ubuntu.com/developer/account_admin/auth/web
- API reference: https://one.ubuntu.com/developer/contents
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Vimeo(*args, **kwargs)[source]¶
Vimeo OAuth 1.0a provider.
Warning
Vimeo needs one more fetch to get rich user info!
- Dashboard: https://developer.vimeo.com/apps
- Docs: https://developer.vimeo.com/apis/advanced#oauth-endpoints
- API reference: https://developer.vimeo.com/apis
Supported User properties:
- id
- link
- location
- name
- picture
Unsupported User properties:
- birth_date
- city
- country
- gender
- first_name
- last_name
- locale
- nickname
- phone
- postal_code
- timezone
- username
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Xero(*args, **kwargs)[source]¶
Xero OAuth 1.0a provider.
Note
API returns XML!
- Dashboard: https://api.xero.com/Application
- Docs: http://blog.xero.com/developer/api-overview/public-applications/
- API reference: http://blog.xero.com/developer/api/
Supported User properties:
- first_name
- id
- last_name
- name
Unsupported User properties:
- birth_date
- city
- country
- gender
- link
- locale
- location
- nickname
- phone
- picture
- postal_code
- timezone
- username
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Yahoo(*args, **kwargs)[source]¶
Yahoo OAuth 1.0a provider.
- Dashboard: https://developer.apps.yahoo.com/dashboard/
- Docs: http://developer.yahoo.com/oauth/guide/oauth-auth-flow.html
- API: http://developer.yahoo.com/everything.html
- API explorer: http://developer.yahoo.com/yql/console/
Supported User properties:
- birth_date
- city
- country
- gender
- id
- link
- location
- name
- nickname
- picture
Unsupported User properties:
- locale
- phone
- postal_code
- timezone
- username
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
- class authomatic.providers.oauth1.Xing(*args, **kwargs)[source]¶
Xing OAuth 1.0a provider.
- Dashboard: https://dev.xing.com/applications
- Docs: https://dev.xing.com/docs/authentication
- API reference: https://dev.xing.com/docs/resources
Supported User properties:
- birth_date
- city
- country
- first_name
- gender
- id
- last_name
- link
- locale
- location
- name
- phone
- picture
- postal_code
- timezone
- username
Unsupported User properties:
- nickname
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id – A unique short name used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access token request.
- request_token_params (dict) – A dictionary of additional request parameters for request token request.
OpenID Providers¶
Providers which implement the OpenID protocol based on the python-openid library.
Warning
This providers are dependent on the python-openid package.
| OpenID(*args, **kwargs) | OpenID provider based on the python-openid library. |
| Yahoo(*args, **kwargs) | Yahoo OpenID provider with the identifier predefined to "me.yahoo.com". |
| Google(*args, **kwargs) | Google OpenID provider with the identifier predefined to "https://www.google.com/accounts/o8/id". |
- class authomatic.providers.openid.OpenID(*args, **kwargs)[source]¶
OpenID provider based on the python-openid library.
Accepts additional keyword arguments:
Parameters: - store – Any object which implements openid.store.interface.OpenIDStore of the python-openid library.
- use_realm (bool) – Whether to use OpenID realm. If True the realm HTML document will be accessible at {current url}?{realm_param}={realm_param} e.g. http://example.com/path?realm=realm.
- realm_body (str) – Contents of the HTML body tag of the realm.
- realm_param (str) – Name of the query parameter to be used to serve the realm.
- xrds_param (str) – The name of the query parameter to be used to serve the XRDS document.
- sreg (list) – List of strings of optional SREG fields. Default = OpenID.SREG.
- sreg_required (list) –
List of strings of required SREG fields. Default = [].
- ax (list) – List of strings of optional AX schemas. Default = OpenID.AX.
- ax_required (list) –
List of strings of required AX schemas. Default = OpenID.AX_REQUIRED.
- pape (list) – of requested PAPE policies. Default = OpenID.PAPE.
As well as those inherited from AuthenticationProvider constructor.
- class authomatic.providers.openid.Yahoo(*args, **kwargs)[source]¶
Yahoo OpenID provider with the identifier predefined to "me.yahoo.com".
Accepts additional keyword arguments:
Parameters: - store – Any object which implements openid.store.interface.OpenIDStore of the python-openid library.
- use_realm (bool) –
Whether to use OpenID realm. If True the realm HTML document will be accessible at {current url}?{realm_param}={realm_param} e.g. http://example.com/path?realm=realm.
- realm_body (str) – Contents of the HTML body tag of the realm.
- realm_param (str) – Name of the query parameter to be used to serve the realm.
- xrds_param (str) –
The name of the query parameter to be used to serve the XRDS document.
- sreg (list) –
List of strings of optional SREG fields. Default = OpenID.SREG.
- sreg_required (list) –
List of strings of required SREG fields. Default = [].
- ax (list) –
List of strings of optional AX schemas. Default = OpenID.AX.
- ax_required (list) –
List of strings of required AX schemas. Default = OpenID.AX_REQUIRED.
- pape (list) –
of requested PAPE policies. Default = OpenID.PAPE.
As well as those inherited from AuthenticationProvider constructor.
- class authomatic.providers.openid.Google(*args, **kwargs)[source]¶
Google OpenID provider with the identifier predefined to "https://www.google.com/accounts/o8/id".
Accepts additional keyword arguments:
Parameters: - store – Any object which implements openid.store.interface.OpenIDStore of the python-openid library.
- use_realm (bool) –
Whether to use OpenID realm. If True the realm HTML document will be accessible at {current url}?{realm_param}={realm_param} e.g. http://example.com/path?realm=realm.
- realm_body (str) – Contents of the HTML body tag of the realm.
- realm_param (str) – Name of the query parameter to be used to serve the realm.
- xrds_param (str) –
The name of the query parameter to be used to serve the XRDS document.
- sreg (list) –
List of strings of optional SREG fields. Default = OpenID.SREG.
- sreg_required (list) –
List of strings of required SREG fields. Default = [].
- ax (list) –
List of strings of optional AX schemas. Default = OpenID.AX.
- ax_required (list) –
List of strings of required AX schemas. Default = OpenID.AX_REQUIRED.
- pape (list) –
of requested PAPE policies. Default = OpenID.PAPE.
As well as those inherited from AuthenticationProvider constructor.
Google App Engine OpenID Providers¶
OpenID provider implementations based on the Google App Engine Users API.
Note
When using the GAEOpenID provider, the User object will always have only the User.user_id, User.email, User.gae_user attributes populated with data. Moreover the User.user_id will always be empty on the GAE Development Server.
| GAEOpenID(*args, **kwargs) | OpenID provider based on the Google App Engine Users API. |
| Yahoo(*args, **kwargs) | GAEOpenID provider with the identifier set to "me.yahoo.com". |
| Google(*args, **kwargs) | GAEOpenID provider with the identifier set to "https://www.google.com/accounts/o8/id". |
- class authomatic.providers.gaeopenid.GAEOpenID(*args, **kwargs)[source]¶
OpenID provider based on the Google App Engine Users API.
Accepts additional keyword arguments inherited from AuthenticationProvider.
Abstract Classes for Providers¶
Abstract base classes for implementation of protocol specific providers.
Note
Attributes prefixed with _x_ serve the purpose of unification of differences across providers.
| login_decorator(func) | Decorate the BaseProvider.login() implementations with this decorator. |
| BaseProvider(settings, adapter, provider_name) | Abstract base class for all providers. |
| AuthorizationProvider(*args, **kwargs) | Base provider for authorization protocols i.e. |
| AuthenticationProvider(*args, **kwargs) | Base provider for authentication protocols i.e. |
- authomatic.providers.login_decorator(func)[source]¶
Decorate the BaseProvider.login() implementations with this decorator.
Provides mechanism for error reporting and returning result which makes the BaseProvider.login() implementation cleaner.
- class authomatic.providers.BaseProvider(settings, adapter, provider_name, session=None, session_saver=None, callback=None, js_callback=None, prefix='authomatic', **kwargs)[source]¶
Abstract base class for all providers.
- callback = None¶
callable An optional callback called when the login procedure is finished with core.LoginResult passed as argument.
- popup = None¶
bool If True, the BaseProvider.user_authorization_url will be displayed in a popup mode, if the provider supports it.
- login()[source]¶
Launches the login procedure to get user’s credentials from provider.
Should be decorated with login_decorator(). The login procedure is considered finished when the user attribute is not empty when the method runs out of it’s flow or when there are errors.
- classmethod get_type()[source]¶
Returns the provider type.
Returns: str The full dotted path to base class e.g. "authomatic.providers.oauth2.OAuth2".
- static csrf_generator(secret)[source]¶
Generates CSRF token.
Inspired by this article: http://blog.ptsecurity.com/2012/10/random-number-security-in-python.html
Returns: str Random unguessable string.
- class authomatic.providers.AuthorizationProvider(*args, **kwargs)[source]¶
Base provider for authorization protocols i.e. protocols which allow a provider to authorize a consumer to access protected resources of a user. e.g. OAuth 2.0 or OAuth 1.0a.
Accepts additional keyword arguments:
Parameters: - consumer_key (str) – The key assigned to our application (consumer) by the provider.
- consumer_secret (str) – The secret assigned to our application (consumer) by the provider.
- id (int) – A unique numeric ID used to serialize Credentials.
- user_authorization_params (dict) – A dictionary of additional request parameters for user authorization request.
- access_token_params (dict) – A dictionary of additional request parameters for access_with_credentials token request.
- access_headers (dict) – A dictionary of default HTTP headers that will be used when accessing user’s protected resources. Applied by access(), update_user() and User.update()
- access_params (dict) – A dictionary of default query string parameters that will be used when accessing user’s protected resources. Applied by access(), update_user() and User.update()
- same_origin = True¶
If True the provider doesn’t support Cross-site HTTP requests.
- credentials = None¶
Credentials to access user’s protected resources.
- access_token_response = None¶
Response of the access token request.
str URL to which we redirect the user to grant our app i.e. the consumer an authorization to access his protected resources. see http://tools.ietf.org/html/rfc6749#section-4.1.1 and http://oauth.net/core/1.0a/#auth_step2.
- access_token_url[source]¶
str URL where we can get the access token to access protected resources of a user. see http://tools.ietf.org/html/rfc6749#section-4.1.3 and http://oauth.net/core/1.0a/#auth_step3.
- user_info_url[source]¶
str URL where we can get the user info. see http://tools.ietf.org/html/rfc6749#section-7 and http://oauth.net/core/1.0a/#anchor12.
- to_tuple(credentials)[source]¶
Must convert credentials to a tuple to be used by Credentials.serialize().
Warning
Must be a classmethod!
Parameters: credentials – Credentials Returns: tuple
- reconstruct(deserialized_tuple, credentials, cfg)[source]¶
Must convert the deserialized_tuple back to Credentials.
Warning
Must be a classmethod!
Parameters: - deserialized_tuple (tuple) – A tuple whose first index is the id and the rest are all the items of the tuple created by to_tuple().
- credentials – A Credentials instance.
- cfg (dict) – Provider configuration from Config.
- create_request_elements(request_type, credentials, url, method='GET', params=None, headers=None, body='')[source]¶
Must return RequestElements.
Warning
Must be a classmethod!
Parameters: - request_type (int) – Type of the request specified by one of the class’s constants.
- credentials – Credentials of the user whose protected resource we want to access.
- url (str) – URL of the request.
- method (str) – HTTP method of the request.
- params (dict) – Dictionary of request parameters.
- headers (dict) – Dictionary of request headers.
- body (str) – Body of POST, PUT and PATCH requests.
Returns: RequestElements
- type_id[source]¶
A short string representing the provider implementation id used for serialization of Credentials and to identify the type of provider in JavaScript. The part before hyphen denotes the type of the provider, the part after hyphen denotes the class id e.g. oauth2.Facebook.type_id = '2-5', oauth1.Twitter.type_id = '1-5'.
- access(url, params=None, method='GET', headers=None, body='', max_redirects=5, content_parser=None)[source]¶
Fetches the protected resource of an authenticated user.
Parameters: - credentials – The user’s Credentials (serialized or normal).
- url (str) – The URL of the protected resource.
- method (str) – HTTP method of the request.
- headers (dict) – HTTP headers of the request.
- body (str) – Body of POST, PUT and PATCH requests.
- max_redirects (int) – Maximum number of HTTP redirects to follow.
- content_parser (function) – A function to be used to parse the Response.data from Response.content.
Returns:
- async_access(*args, **kwargs)[source]¶
Same as access() but runs asynchronously in a separate thread.
Warning
The internal implementation of the future pattern is quite naive. Use with caution!
Returns: Future instance representing the separate thread.
- update_user()[source]¶
Updates the BaseProvider.user.
Warning
Fetches the user_info_url!
Returns: UserInfoResponse
- class authomatic.providers.AuthenticationProvider(*args, **kwargs)[source]¶
Base provider for authentication protocols i.e. protocols which allow a provider to authenticate a claimed identity of a user. e.g. OpenID.
- has_protected_resources = False¶
Indicates whether the provider supports access_with_credentials to user’s protected resources.


- Register
- Assessment
- Override
- Interview
- Enrolment
Client: Soban Kahn
Override
| Visa grant number |<PHONE_NUMBER>234 |
|---|---|
| Visa subclass | 136 |
| 2nd VAC | Paid |
| Visa commencement date | 5 January 2018 |
| Date of birth | 10 Jan 1978 |
| Gender | Male |
| Country of birth | Afghanistan |
| Language | Farsi |
| Principal applicant | Yes |
0
days remaining for registration
05 Jul 2018
109
days remaining to enrol
05 Jan 2019
1570
days to entitlement end
04 Jan 2023


"Light Makes Right"
October 13, 1989
Volume 2, Number 7
Compiled by
All contents are copyright (c) 1989, all rights reserved by the individual authors
Archive locations: anonymous FTP at
ftp://ftp-graphics.stanford.edu/pub/Graphics/RTNews/,
wuarchive.wustl.edu:/graphics/graphics/RTNews, and many others.
You may also want to check out the Ray Tracing News issue guide and the ray tracing FAQ.
Next month I hope to collect various timing information from all sorts of ray tracers on all sorts of machines. I hope to do a "trace-off" sometime soon, comparing MTV's, Craig's, DBW, QRT, ART, mine, and any others I can get up and running. If anyone else has any timings or observations on performance of ray tracers and various machines, please send them to me.
back to contents
David Hook<EMAIL_ADDRESS>Dept. Of Engineering Computer Resources University Of Melbourne Parkville, Vic, 3052 Australia
G'day.
Our major area of interest in ray tracing is CSG modeling and we have a locally developed ray tracer which is a step towards this, as a department we are also involved with the Faculty of Architecture at this University, so we are starting to look at special effects somewhat more seriously than before. This has also led to a greater interest in acceleration techniques.
Personally, I am currently doing a masters degree in the area of CSG and ways of introducing patches into the model. The rendering technique being used is ray tracing.
[And a further note from David Hook:]
The mailing list has been set up on munnari, so if you send it to<EMAIL_ADDRESS>it will (should) travel around Oz to the people who want it. I am asking people who subscribe if they wish to be on the contact list, etc...
As a bit of additional info, I have written a ray-tracer which does CSG and renders algebraic surfaces, (ala Pat Hanrahan), although in this case it's built around Sturm Sequences and we occasionally use CSG to take cross-sections of the surfaces. The interest in algebraic surfaces began because a friend of mine was struggling with a 6th order surface known as the Hunt Surface, getting a good feel for the cusps on it was turning out to be awful using polygonal subdivision. In any case there is a public domain version of all this sitting in pub on munnari.OZ.AU (<IP_ADDRESS>) which can be got by anonymous ftp. The file is vort.tar.Z. Knowing a bit more about the whole business now, it's a bit of an embarrassment! Still it may be of interest to someone and constructive criticism is always welcome.
[From a README file in his ray tracing distribution:]
By the by, for people who are interested, there are an excellent series of papers on ray tracing and computer graphics in general published in the NATO ASI Series of books. The volume in question is in Vol. 40, series F, and is titled "Theoretical Foundations of Computer Graphics and CAD". It was published in 1988 Springer-Verlag. Roman Kuchkuda's paper in it "An Introduction To Ray Tracing", would be the best introductory paper we have seen to date. Apart from that it was the first paper we found that actually said what a superquadric was!
________
NAME: Hench, Stephen D. SNAIL MAIL: 2621-C Stewart Drive E MAIL<EMAIL_ADDRESS>Raleigh, NC 27603
BRIEF: Undergrad in Mathematics and Computer Science at NCSU. Interested in ray tracing (would I want to subscribe if I wasn't?), radiosity, and rendering in general.
________
Marshall Levine 136 1937 Hall Wilson College Princeton University Princeton, NJ 08544<PHONE_NUMBER>
Home: Marshall Levine 5212 Louise Avenue Encino, California 91316<PHONE_NUMBER><PHONE_NUMBER>
E-mail: (1<EMAIL_ADDRESS>or: (2<EMAIL_ADDRESS>or: (3<EMAIL_ADDRESS>My main interests are helicopters and computer graphics. Within graphics, I am interested in animation and motion control. While I think it is great to see a ray-traced magnifying glass sitting on top of a cicuit board, I would rather see the magnifying glass fly smoothly over a spinning board while the camera flies smoothly through the scene. I am currently designing a flexible graphics language with a friend of mine, Chris Williams (Princeton U. '92). If anyone is interested, I can say more about that later.
________
Cornell Program of Computer Graphics
A ray tracing mailing list has been set up by Tim O'Connor:
<EMAIL_ADDRESS>Program of Computer Graphics 120 Rand Hall Cornell University Ithaca, NY 14853
People on this list who've already been intro'ed here include: Roy Hall, Mark Reichert, Ben Trumbore, and Tim O'Connor.
New people and brief bio sketches:
Wash Wawrzynek -<EMAIL_ADDRESS>Current interest are user interfaces and visualization for computational mechanics.
________
Len Wanger -<EMAIL_ADDRESS>My sketch is on a piece of paper, but my interests are: I am a graduate student in the department of computer graphics at Cornell University. I am interested in modeling and visual perception.
________
Filippo Tampieri -<EMAIL_ADDRESS>Areas of interest: parallel/distributed ray tracing, fast algorithms for ray tracing.
________
Ricardo Pomeranz -<EMAIL_ADDRESS>Interests: constructive solid geometry and rendering
________
Paul Wanuga -<EMAIL_ADDRESS>Masters student at Cornell's Computer Graphics Lab. Interests - rendering realistic complex environments in realistic times.
________
Kathy Kershaw -<EMAIL_ADDRESS>I'm Kathy Kershaw. I did the ray tracing thing once. Maybe it'll have something to do w/ my master's thesis; maybe not.
________
Colin Summers -<EMAIL_ADDRESS>Just recently interested in computer graphics and heading into the abyss from the architecture side, I have a background in personal computers and spent a year out of the design studio to computer consult in Manhattan. Glad to be back in the world of academia. As soon as someone comes across with a Macintosh like text processor for xWindows, let me know.
________
Ted Himlan -<EMAIL_ADDRESS>Color science, radiometric measurement, array camera. interest: detailed measurements on an environment for comparison to simulation.
________
Julie O'Brien Dorsey -<EMAIL_ADDRESS>Computer aided design applications, radiosity, lighting design
________
Francois Sillion -<EMAIL_ADDRESS>I am currently on a Post-Doc position at Cornell, after having completed my PhD at the 'Ecole Normale Superieure' in Paris, France, where my work included the development of a two-pass method for lighting calculations, combining ray tracing and radiosity.
My interests are illumination models (local and global), animation and interactivity.
back to contents
From their literature: "SSM was written in standard C with Silicon Graphic's Iris Graphics Library calls and AT&T PicLib calls.... The program is available for the Silicon Graphics IRIS workstation running version 3.1 of IRIX, and a Sun Workstation with AT&T PXM964 running 4.2 BSD."
For more information contact: COSMIC The University of Georgia 382 East Broad Street Athens, GA 30602<PHONE_NUMBER>
(Followup article in RTNv15n1.)
back to contents
{ clusters.p
Written by Marshall Levine (Princeton University '92) e-mail<EMAIL_ADDRESS>Algorithm designed by Marshall Levine and Chris Williams (Princeton U. '92)
This program searches through a 3-dimensional space of randomly distributed points for a cluster of 10 stars within the smallest radius possible.
I first implemented a "pri" list. This is a linked list of real numbers (representing distances). The list is kept in order. However, when a number that would go farther into the list than the number of points per sphere (NUMINSPHERE) tries to go into the list, the insert procedure stops it. This is done because the distance is useless. For example, if NUMINSPHERE is 5 and a number would be inserted into the 7th slot in the list, it is not inserted. The minimum radius of a sphere with 5 points would be determined by the 5th element of the list (not including the header), so any number inserted after the 5th element is useless and is therefore not inserted. If there are not NUMINSPHERE elements in the pri, then there are not enough points to fill the sphere.
The brute-force algorithm loops through every point in space. For each point, the algorithm finds the distance between that point and every other point and puts that distance into the pri. When all points have been compared against this point, the NUMINSPHERE'th element is taken to be the minimum radius of a sphere centered at this point containing NUMINSPHERE points. However, points are not compared against themselves, so the exact number of comparisons is N^2-N, making this an N^2 algorithm.
The efficient algorithm designed by Chris Williams and me divides the space into a 3-dimensional grid. If the grid is divided into NUMPOINTS/NUMINSPHERE sectors, then at least one of the sectors must have at least NUMINSPHERE points. Now, make spheres with the same volume as the sectors. At least one sphere surrounding one point will have at least NUMINSPHERE points. It turns out that the tradeoff between fewer computations and more overhead is minimized by choosing the grid to have enough sectors such that each sector is r/2 on each side (where r is the radius of the aforementioned sphere). Our algorithm starts with a sphere radius equal to the distance from one corner of the unit cube to another (3^.5). Given the first point in the list, we compare that point against every other point in sectors touching the sphere (In this case, every other point in space!) By storing the distances and then taking the NUMINSPHERE'th number from the pri list, as in the brute algorithm, we frequently reduce the size of the sphere. Then, we check the next point with the new, smaller sphere size and continue in this way until we have tested every point. As we go along, the minimum sphere size keeps shrinking until for any given point, we only check a few neighboring sectors, if any. In practice, this radius shrinks so quickly that the algorithm displays LINEAR BEHAVIOR!
NOTE: This program was written for clarity, not for efficiency. If it is to be used in any real applications, there are many ways to speed it up.
Bruteforce: Our algorithm: (Average of 3 runs) Points: #Comparisons: comps/points: #Comparisons: comps/points: 50 2450 49.000 958 19.160 75 5550 74.000 1241 16.547 100 9900 99.000 2111 21.110 150 22350<PHONE_NUMBER> 18.567 200 3689 18.445 250 5120 20.480 300 6010 20.033 350 7149 20.426 400 7658 19.145 600 11404 19.007 800 16781 20.976 1000 20438 20.438
Testing 50 points. Brute-force: Best sphere: 0.3067962678 Number of comparisons: 2450 Efficient Algorithm: Best sphere: 0.3067962678 Number of comparisons: 946
%time cumsecs #call ms/call name 31.6 0.10 1 100.01 _brutecluster <==== 10.5 0.18 1 33.34 _elegantcluster <==== 5.3 0.25 101 0.17 _clearprilist 5.3 0.27 581 0.03 _insertprilist 5.3 0.28 1 16.67 _makespace
Testing 300 points. Brute-force: Best sphere: 0.1569231423 Number of comparisons: 89700 Efficient Algorithm: Best sphere: 0.1569231423 Number of comparisons: 5617
%time cumsecs #call ms/call name 44.2 3.27 1 3267.00 _brutecluster <==== 2.9 6.82 1 216.69 _elegantcluster <==== 1.1 7.00 2358 0.04 _insertprilist 0.2 7.33 601 0.03 _clearprilist 0.0 7.38 1 0.00 _makespace }
{==========================================================================} program clusters(input,output); const MAXNUMPOINTS = 501; { The maximum # of points we can handle } NUMINSPHERE = 10; { # stars to find inside sphere } INFINITY = 999999.9; { Larger than largest distance possible } MAXUSESPACE = 20; { Maximum length per edge of space-grid } PI = 3.1415926535; type datatype = real; point = record { The type of a point } x : real; y : real; z : real; data : datatype; end; ptr = ^node; node = record { Linked list for a distances list called "pri" } data : real; next : ptr; end; sptr = ^spacenode; { Linked list for each sector in the space-grid } spacenode = record index : integer; { Stores index of that point in points[] } next : sptr; end; var rndnm : integer; { Needed for the random number generator } points : array [1..MAXNUMPOINTS] of point; { All points in space } listhead : ptr; { List head for distances list called "pri" } space : array[0..MAXUSESPACE, 0..MAXUSESPACE, 0..MAXUSESPACE] of sptr; { The space-grid (hereafter called 'grid') } spacesize, usespace : integer; { Size per edge of grid } NUMPOINTS : integer; { The number of points we have in space } { **************** Support routines for random generators ************** } procedure seed; { Seed the random number generator } begin writeln('seed:'); readln(rndnm); end; function rndom(scale : integer) : real; { Make random real from 0 to scale } begin rndnm := abs(abs((rndnm*921+1)) mod 32749); rndom := (rndnm*scale/32749) end; procedure randompoint(var pt : point); { Generate a random point within } begin { a unit cube. } pt.x := rndom(1); pt.y := rndom(1); pt.z := rndom(1) end; procedure generatepoints; { Generate NUMPOINTS points in space } var x : integer; begin for x := 1 to NUMPOINTS do randompoint(points[x]) end; { *************** Support routines for the "pri" list ******************** } procedure initprilist; { Initialize the pri list } begin new(listhead); listhead^.data := 0.0; new(listhead^.next); listhead^.next^.data := INFINITY; listhead^.next^.next := nil end; procedure clearprilist; { Clear the pri list } var p,oldp : ptr; begin p := listhead; while p <> nil do begin oldp := p; p := p^.next; dispose(oldp) end; new(listhead); listhead^.data := 0.0; new(listhead^.next); listhead^.next^.data := INFINITY; listhead^.next^.next := nil end; procedure insertprilist(r : real); { Insert a distance into pri list } var p,oldp,temp : ptr; { "pri" is just a linked list of distances } x : integer; { kept in low -> high order. The catch is } begin { that if a number should be inserted after } x := 1; { the NUMINSPHERE'th node, we don't bother } p := listhead^.next; { inserting it, because it isn't in the } oldp := listhead; { smallest sphere with NUMINSPHERE points. } while (r > p^.data) and (x <= NUMINSPHERE) do begin oldp := p; p := p^.next; x := x + 1 end; if x <= NUMINSPHERE then begin new(temp); temp^.data := r; temp^.next := p; oldp^.next := temp end end; function getbiggestinsphere : real; { Returns value of the NUMINSPHERE'th } var x : integer; { element in pri list, or INFINITY } p : ptr; { if the list isn't that long. } begin x := 1; p := listhead^.next; while (x < NUMINSPHERE) and (p <> nil) do begin x := x + 1; p := p^.next end; if (x < NUMINSPHERE) or (p = nil) then getbiggestinsphere := INFINITY else getbiggestinsphere := p^.data end; procedure printprilist; { Print the pri list, for debugging } var p : ptr; begin p := listhead; { DO print the head } while p <> nil do begin writeln(p^.data:15:10); p := p^.next end; writeln('nil') end; { ******************* Miscellaneous support routines ******************** } procedure printpoint(pt : point); { Print out a point } begin writeln('(',pt.x:8:5,',',pt.y:8:5,',',pt.z:8:5,')') end; function cube(x : real) : real; { Return cube root of a number } begin cube := exp((1/3)*ln(x)) end; { *********************** Brute Force algorithm ************************* } procedure brutecluster; { Find minimum sphere containing NUMINSPHERE } { points by testing the distance between } { every point. } var distx,disty,distz,dist : real; { Find distance between two points } bestsphere,trysphere : real; { Find minimum sphere } numcomps : integer; { # comparisons } thispoint,againstpoint : integer; { Counters } begin clearprilist; { Kill the priority list } bestsphere := INFINITY; numcomps := 0; for thispoint := 1 to NUMPOINTS do { Test every point... } begin clearprilist; for againstpoint := 1 to NUMPOINTS do { ...against every other point } if thispoint <> againstpoint then { Don't compare point against self} begin distx := points[thispoint].x - points[againstpoint].x; disty := points[thispoint].y - points[againstpoint].y; distz := points[thispoint].z - points[againstpoint].z; dist := sqrt(distx*distx + disty*disty + distz*distz); numcomps := numcomps + 1; if dist < bestsphere then { If dist less than smallest sphere,} insertprilist(dist) { insert distance into pri list } end; trysphere := getbiggestinsphere; { Get 'NUMINSPHERE'th item from list } if trysphere < bestsphere then { If this radius is the smallest yet,} bestsphere := trysphere; { then remember it. } end; writeln('Brute-force:'); writeln(' Best sphere: ',bestsphere:15:10); writeln(' Number of comparisons: ',numcomps:8) end; { **************************** My algorithm *********************** } procedure makespace; { Build the space-grid. See documentation at } var x,y,z : integer; { beginning of program for details. } temp : sptr; thispoint : integer; begin spacesize := trunc(cube(8*PI*NUMPOINTS/NUMINSPHERE)); usespace := spacesize-1; if usespace > MAXUSESPACE then writeln('****** NOT ENOUGH MEMORY FOR GRID'); for x := 0 to usespace do for y := 0 to usespace do for z := 0 to usespace do space[x,y,z] := nil; { Clear the grid } for thispoint := 1 to NUMPOINTS do { Go through every point... } begin new(temp); temp^.index := thispoint; x := trunc(points[thispoint].x * spacesize); y := trunc(points[thispoint].y * spacesize); z := trunc(points[thispoint].z * spacesize); temp^.next := space[x,y,z]; { Put this point into proper } space[x,y,z] := temp; { sector in grid. } end end; procedure elegantcluster; { Find smallest sphere containing NUMINSPHERE } { points by looping through every point, } { checking ROUGHLY only the points within } { a radius less than or equal to the } { minimum radius found so far. } var bestsphere,trysphere : real; xmin,xmax,ymin,ymax,zmin,zmax : integer; { Dimensions of box to check } thispoint : integer; { The current point to test against } x,y,z : integer; { The current grid we are testing } distx,disty,distz,dist : real; { For computing distances } numcomps : integer; { # comparisons } cpindex : sptr; { Pointer into point list for a grid sector } begin makespace; bestsphere := 1.732050808; { Start with radius of distance from one } numcomps := 0; { corner of unit cube to other: 3^.5 } for thispoint := 1 to NUMPOINTS do { Loop for every point } begin clearprilist; xmin := trunc((points[thispoint].x - bestsphere) * spacesize); xmax := trunc((points[thispoint].x + bestsphere) * spacesize); ymin := trunc((points[thispoint].y - bestsphere) * spacesize); ymax := trunc((points[thispoint].y + bestsphere) * spacesize); zmin := trunc((points[thispoint].z - bestsphere) * spacesize); zmax := trunc((points[thispoint].z + bestsphere) * spacesize); if xmin < 0 then xmin := 0; if ymin < 0 then ymin := 0; { Get dimensions of box } if zmin < 0 then zmin := 0; { containing every sector in } if xmax > usespace then xmax := usespace; { grid that we want to check } if ymax > usespace then ymax := usespace; { against the current point } if zmax > usespace then zmax := usespace; for x := xmin to xmax do for y := ymin to ymax do for z := ymin to ymax do { Loop through every sector in this box } begin cpindex := space[x,y,z]; while cpindex <> nil do { Test against every point in this sector} begin if thispoint <> cpindex^.index then { Don't test point against } begin { itself. } distx := points[thispoint].x - points[cpindex^.index].x; disty := points[thispoint].y - points[cpindex^.index].y; distz := points[thispoint].z - points[cpindex^.index].z; dist := sqrt(distx*distx + disty*disty + distz*distz); numcomps := numcomps + 1; if dist < bestsphere then { If dist less than smallest sphere} insertprilist(dist) { insert distance into pri list } end; cpindex := cpindex^.next { Get next point in this sector } end end; trysphere := getbiggestinsphere; if trysphere < bestsphere then bestsphere := trysphere end; writeln('Efficient Algorithm:'); writeln(' Best sphere: ',bestsphere:15:10); writeln(' Number of comparisons: ',numcomps:8) end; begin seed; writeln('How many points?'); readln(NUMPOINTS); if NUMPOINTS < NUMINSPHERE then writeln('***** Must have at least ',NUMINSPHERE:1,' points.') else begin writeln('Testing ',NUMPOINTS:1,' points.'); initprilist; generatepoints; brutecluster; elegantcluster end end.
back to contents
Howdy folks....
It's survey time again, and I would appreciate your participation in this version of twenty questions.
I am interested in parallel algorithms for ray tracing, and I am curious about a couple of things. Please note that I have most of the "standard references" that get cited in the literature, but I am interested in some of the OTHER stuff that is out there.
The papers that I have:
Cleary et al. "Multiprocessor Ray Tracing", Internal Report, 83/128/17, Department of Computer Science, University of Calgary, Calgary, Alberta, Canada.
Dippe et al "An Adaptive Subdivision Algorithm and Parallel Architecture for Realistic Image Synthesis", Computer Graphics, Volume 18, Number 3.
Gaudet et al "Multiprocessor Experiments for High Speed Ray Tracing", ACM TOG, Volume 7, Number 3.
etc.....
What I am interested in are references to some of the goodies that are out there in the real world. Are there any papers on the hardware Pixar uses. How about the AT&T pixel machine, the Connection Machine (there is a piece on it in Scientific American, Volume 256, Number 6 that I already have), and other bizarre architectures. Dave Jevans from the University of Calgary (Hi Dave, remember me? I met you at SIGGRAPH this year) mentioned at one point he implemented some stuff on a BBN Butterfly (I think). Any more info on that Dave? Did you write it up? Anybody else doing anything similar?
Here is the info I want....
1) What architecture do you run on? 2) Parallel, vectorized etc?
For parallel systems:
3) How many processors do you use? 4) How tightly coupled are they? 5) Do you perform any load balancing, and if so how? 6) Architectural requirements (memory/node, communications etc)? 7) Anything else you can think of that might be useful.
Thanks in advance for any help you can give me. Replies by email are of course the best route to take, but I read comp.graphics every morning, so a reply here will be seen. I will post a summary to the net if I get enough information.
========
Question number two....
This should be quick and easy.
We have all seen the pretty pictures, but how do they get created? I would appreciate a quick or not so quick review of what kind of software is used at your site to model 3D scenes.
For those of you in the RT News mailing list and don't read the net like I do, I will send a copy of both this and the summary to Eric.
Thanks,
Brian
back to contents
======== USENET cullings follow =====================
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Organization: Math Department, Yale University
All of this talk of solid texturing and the like has convinced me to pull together my raytracer for public consumption. Although I'm calling this a beta release, relatives of this version of rayshade have been making pretty pictures for about a year now. For examples, see slides 32 and 57 from the SIGGRAPH '89 technical slide set and slides 67/68 from the stereo slide set.
If there's enough interest, I'll post rayshade to comp.sources.unix once the bugfixes stop rolling in.
[I would like to add that Craig's ray tracer is fairly nice, and most of the portability problems and minor bugs have been fixed since its release. Its input language is much more full featured than NFF (which, I'll say again, was made only for testing ray tracers, not photorealism) and looks more mainstream than some of the other public domain ray tracers I've seen. If you're looking for a reasonable input language, check his out. His latest and greatest version (i.e. newer that 2.21) might be available via ftp by now. - EAH]
--
Rayshade, a raytracing program, is available for "Beta" testing. Rayshade reads a multi-line ASCII file describing a scene to be rendered and produces a Utah Raster RLE format file of the raytraced image.
Features:
Primitives: boxes cones cylinders height fields planes polygons spheres triangles (flat- or Phong-shaded) [he forgot to mention there are also superquadrics! - EAH]
Composite objects
Point, directional, and extended (area) light sources
Solid texturing and bump mapping of primitives, objects, and individual instances of objects
Antialiasing through adaptive supersampling or "jittered" sampling
Arbitrary linear transformations of primitives, instances of objects, and texture/bump maps
Use of uniform spatial subdivision and/or hierarchy of bounding volumes to speed rendering
Options to facilitate rendering of stereo pairs
Support for the Linda parallel programming language
An awk script is provided to translate NFF format scripts to rayshade format.
Rayshade is written in C with parsing support provided through lex and yacc. The C, lex and yacc files comprise approximately eight thousand lines of code. Sites without lex and yacc can make use of the C source files produced by lex and yacc which are included in this distribution.
Rayshade has been tested on a number of UNIX-based machines, including Vaxes, Sun Workstations, Iris 4D Workstations, Encore Multimax, AT&T 3B2/310, Cray XMP, and IBM RTs. In addition, support is provided for the Amiga using the Aztec C compiler.
Rayshade makes use of the Utah Raster toolkit, a package consisting of a large number of useful image manipulation programs, test images, and a library to read and write images written using the toolkit's RLE format. The toolkit is available via anonymous FTP from cs.utah.edu or from weedeater.math.yale.edu.
Those sites that cannot or do not want to use the Utah Raster toolkit can make use of a compile-time option to produce images written using a generic file format identical to that used in Mark VandeWettering's "MTV" raytracer.
This version of rayshade is a "beta" release. The first "real" release will include an updated manual page and additional documentation as well as any bugfixes or extensions born out of this release.
Rayshade is copyrighted in a "Gnu-like" manner.
Rayshade is available via anonymous ftp from weedeater.math.yale.edu (<IP_ADDRESS>) in pub/Rayshade.2.21.tar.Z. The Utah Raster toolkit is available in pub/UtahToolkit.tar.Z.
back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics
Straight from the dragon's mouth (so to speak) comes the source from "Illumination and Color in Computer Generated Imagery" by Roy Hall. It's now available via anonymous ftp from:
freedom.graphics.cornell.edu (<IP_ADDRESS>)
It's under pub/Hall and comes in two files: 1) README (of course) which also contains some code necessary to convert 2) code.tar.Z.a which contains the actual code. So, as always, read README first.
Those of you who do not have ftp access may wish to drop me a short line (a Subject: of "gimme roy's source" is adequate). If there's enough interest I'll post to this group, if not I'll (shudder!) attempt to mail it right to you.
Also of interest on freedom are the Ray Tracing News archives (under pub/RTNews) and the Xcu Widget Set. (Sorry, this code available only in stores, no mailing.)
fishing in McElligot's Pool, to'c
back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Organization: Math, Stats & CS, Dalhousie University, Halifax,NS, Canada
[This is a continuation of last issue's discussion. The idea here I would consider the most popular solution to the problem. I published most all of the discussion because some of the answers were more interesting for the ideas they generated than for practicality. - EAH]
In article [...]<EMAIL_ADDRESS>(Ranjit Bhatnagar) writes:
> [Talk about 3-d texture maps deleted for brevity]
>I haven't seen discussed before: as generally proposed, it's highly
>unsuited to _animation._ The problem is that you generally define one
>texture function throughout all of space. If an object happens to move,
>its texture changes accordingly. It's a neat effect - try it - but it's
>not what one usually wants to see.
>The obvious solution to this is to define a separate 3-d texture for
>each object, and, further, _cause the texture to be rotated, translated,
>and scaled with the object._ DBW does not allow this, so if you want
>to do animations of any real complexity with DBW, you can't use the nice
>wood or marble textures.
I get around this be keeping not only the general texture stored with the object, but also an (x,y,z) triple pointing to where the texture is to be evaluated. I also keep some orientation information with the object. The texturing routine then only has to translate the scene coordinate of the point being textured into texture coordinates. It comes down to keeping the textures in object coordinates. This allows you to carve more than one object out of the same chunk of marble, which can be quite pleasing. It also requires very little extra manipulation of the texture. For shape changes you just keep track of your deformation function and apply it to the point whose texture you are evaluating.
[Another congruent way of describing this is to use modeling matrices to describe the location (and even deformation) of animated objects. Since the object itself without the modeling matrix does not move, the texturing of its surface does not change. - EAH]
-Paul
(Ps. My raytracer implementing this (and other goodies) should be available as soon as I finish up my spline surfaces...Real Soon Now)
Paul A. Lalonde UUCP: ...{uunet|watmath}!dalcs!dalcsug!lalonde Phone:<PHONE_NUMBER> BITNET<EMAIL_ADDRESS>back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Organization: Florida State University Computing Center
I am going to attempt to employ a few procedural bump-map textures to DBW_Render (I have no idea how they will turn out). I would like to start with some basics, like maybe a "golf-balling" algorithm that will give the surface small, spherical pits. Also, a "cross- hatching" one would be nice as well, one that would produce furrows in a surface. These should work for both planar surfaces as well as spherical ones. So, here's the basic request....given a point, the normal to the surface at that point as well, how can I perturb the normal, position of the point, etc. to create reasonable bump-maps.
One that I'd particularly like to reproduce is found in an old issue of IEEE Computer Graphics & Applications....the one with the Martian Magnolia in it. Well, there's this cross-hatching on the spheres on the previous page. These would be very nice to try to implement in DBW_Render. Can anyone point me to real code (or at least pseudocode) that will tell me how to generate these types of textures? Eventually, with all these textures, bump-mapping, etc. in tow, DBW will be the most kick-butt ray-tracer available to the general public.
back to contents
From<EMAIL_ADDRESS>(Gavin A. Bell) Newsgroups: comp.graphics
In article [...]<EMAIL_ADDRESS>(Ping Kang Hsiung) writes:
>
> Does anyone have a collection of performance (timing) data based
> on running a raytracer (preferably a publicly available raytracer,
> e.g. mtv or qrt) on various machines?
>
I believe that the BRL-CAD ray-tracer is sometimes used as a standard benchmark (with specific input files). A number is generated which they call the 'Ray-tracing figure of merit'; the higher the number, the better. The whole BRL-CAD package is public domain [it's not - see below], but big, crufty, and pretty ancient as ray-tracing packages go.
I know all this because I'm in the Demo/Benchmarks group here at Silicon Graphics, and this ray-tracing benchmark is one of the few in which our 4D/280 outperformed a Cray (ray-tracing being an easily multi-processed, but not vectorizable, application).
If people are interested, I could send them the results.
________
From<EMAIL_ADDRESS>(Phil Dykstra)
The BRL-CAD package is *not* public domain. It is Copyright by the U.S.Army in order to control commercialization of it. We do distribute the source code at no charge however as long as the recipient agrees, in writing, to the conditions.
> but big, crufty, and pretty ancient as ray-tracing packages go.
Being one of the authors, I had to put in at least two cents worth of defense. Big - yes. Crufty - parts of it. Pretty ancient - some of it. But I wouldn't call things like CSG NURBs, arbitrary bounding planes, non-uniform space partitioning, parallel *and* network distributed capability very ancient.
________
From<EMAIL_ADDRESS>(Steve Lamont) Subject: Re: Raytracer performance on machines? Organization: Foo Bar Brewers Cooperative
In article<EMAIL_ADDRESS><EMAIL_ADDRESS>(Ping Kang Hsiung) writes:
>For example, my experience indicates that mtv runs on a
>Cray Y-MP (-hintrinsic,o_level3) ~2.6x than on a PMAX, is this
>(Cray time) the fastest turn-around one can expect?
>Will a Connection Machine do better than this? What about an Intel iPSC?
>The Meiko transputer array? Silicon Graphics's Power series?
Well, it depends on what other things you feel prepared to do. I have both an IRIS 4D/120 and a Y-MP here (we just installed a Stardent Titan yesterday, also) and see the same sort of numbers. I'll run a couple of experiments today and get back to you with actual bench marks, if you'd like.
I am currently working on a parallelized version of MTV and should be able to give you some results from that in a couple of days, barring getting blown away by Hurricane Hugo, that is :-).
In any case, in order to take advantage of any parallelism on an MPP like a CM, you'll probably have to do a lot of recoding. The CM is a SIMD machine which does not really lend itself *directly* to ray tracing. I understand that TMC has done some interesting algorithmic development to actually *do* ray tracing, but the code certainly would not look anything like MTV as it stands right now.  Any comments?
The iPSC and Meiko systems would probably be more straightforward.
If you're interested in results, contact me by private email and I'll be glad to share my thoughts with you.
back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Organization: Advanced Technology Graphics, Apple Computer, Cupertino, CA
In article [...]<EMAIL_ADDRESS>(ROBERT E. MINSK) writes:
> I am currently trying to add texture mapping to my ray tracer. The problem
> I am having is texture mapping and normal interpolation to convex
> quadrilaterals and triangles. The situation is as follows:
> Given 4 points forming a convex planer quadrilateral,the texture vertices
> associated with each point, and the intersection point on the quadrilateral,
> find the associated (u,v) mapping coordinates for the intersection point.
> For example:
> 4 points the associated texture vertices
> p1=(-5, 1, 2) t1=(.2,.4)
> p2=(-2,-3, 6) t2=(.4,.2)
> p3=( 2,-1, 4) t3=(.8,.3)
> p4=( 1, 4,-1) t4=(.7,.5)
> intersection point = (-2,-1, 4)
> find the (u,v) mapping coordinates
>
> I assume a triangle will be the same mapping with two vertices sharing the
> same points and mapping coordinates.
For suitably well-behaved texture mappings (i.e. no bowtie quadrilaterals), there is a projective mapping, that maps quadrilaterals to quadrilaterals. This is represented by a 3x3 matrix, unique up to a scale factor.
[x y z] = [uw vw w] [M] (1)
where w is a homogeneous coordinate, and [M] is the 3x3 matrix. Since the 4 points must obey (1), we have the nonlinear system of equations:
|x0 y0 z0| |u0*w0 v0*w0 w0| |x1 y1 z1| |u1*w1 v1*w1 w1| |x2 y2 z2| = |u2*w2 v2*w2 w2| [M] (2) |x3 y3 z3| |u3*w3 v3*w3 w3|
This represents 12 equations in 13 unknowns, but one of the w's may be arbitrarily chosen as 1.
System (2) can be solved for the matrix [M] by any nonlinear system equation solver, such as those available in the Collected Algorithms of the ACM.
When this matrix is inverted, it gives the mapping you desire:
-1 [uw vw w] = [x y z] [M] (3)
You just plug the desired [x y z] into (3), and divide by w.
For triangles, the mapping (1) is affine:
[x y z] = [u v 1] [M] (4)
and the resulting system is linear:
|x0 y0 z0| |u0 v0 1| |x1 y1 z1| = |u1 v1 1| [M] (5) |x2 y2 z2| |u2 v2 1|
This linear equation (9 equations in 9 unknowns) can easily be solved by LU decomposition.
Note that this matrix computed in (2) and (5) depends only on the parametrization, so its only needs to be computed once, offline, at the time the texture is assigned.
Take note that the texture parameters are not interpolated linearly (or bilinearly), but projectively. Also note that, unlike standard bilinear interpolation (such as that used for Gouraud interpolation) this method of interpolation is rotation invariant.
For more information on projective mappings, see the the book "Projective Geometry and Applications to Computer Graphics" by Penna and Patterson. (I hope this reference is correct -- I'm doing it from memory).
For more detail on this approach to texture-mapping, including texture-mapping by scan-conversion, request a copy of the following paper:
Turkowski, Ken The Differential geometry of Texture Mapping Apple Technical Report No. 10 May 10, 1988
from
Apple Corporate Library Apple Computer, Inc. 20525 Mariani Avenue Mailstop 8-C Cupertino, CA 95014
The e-mail address for the library is<EMAIL_ADDRESS>but the gateway is one-way, so don't expect an electronic reply.
back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Organization: University of Jyvaskyla, Finland
I would like to know is there any simple and effective solution to following problem:
I have curve c:[0,1] -> R*R. Curve c is cubic and it's following form
3 2 3 2 c(t) = (a * t + b * t + c * t + d , a * t + b * t + c * t + d ) x x x x y y y y
Now I rotate curve c around vector v so that I get surface (or what ever I should call it). Let vector v be
v = (x , y , z ) up up up
Now I should calculate intersection of this surface and given line l. Let line l be
l = (k * u + x , k * u + y , k * u + z ), u >= 0 x 0 y 0 z 0
This should be done as fast as possible, because it would be part of ray tracer. I also need surface's normal in the intersection point.
I've been calculating this, but the solution seems to be quite complicated. Is there any other easier way to do something like this?
Could anyone tell me good books which would help me deal with this kind of problems and bicubic surfaces and stuff like that?
back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Organization: U.S. Naval Academy, Annapolis, MD
MATHEMATICAL ELEMENTS FOR COMPUTER GRAPHICS 2nd edition David F. Rogers & J. Alan Adams McGraw-Hill Book Co. 1990
hardcover -- ISBN 0-07-053529-9
My own interest is in asking those of you who use the book for some assistance. No matter how careful the authors and proofreaders are all books have typos. If you use the book and find a typo (or something that you think is wrong) please [send a bug report and] tell me about it. I will have a chance to correct these typos in about June 1990. In a few months, I'll summarize those that I have received and publish an errata list to the net.
Thanks in advance.
Dave Rogers
back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Organization: Carnegie-Mellon University, CS/RI
Has anyone had ported/run raytracing on NCUBE? I would like to learn about your experience; including raytracer name, NCUBE node number (NCUBE 2 or 1?), port time, performance, features/tricks, etc.
back to contents
From<EMAIL_ADDRESS>Newsgroups: comp.graphics Keywords: P, NP, Jordan curve separation, Ursyhon Metrization Theorem Organization: Program of Computer Graphics
In article [...]<EMAIL_ADDRESS>(Timothy Lyle Smith) writes:
>
> I need to find a formula/algorithm to determine if a line intersects
> a polygon. I would prefer a method that would do this in as little
> time as possible. I need this for use in a forward raytracing
> program.
I think that this is a very difficult problem. To start with, lines and polygons are semi-algebraic sets which both contain uncountable number of points. Here are a few off-the-cuff ideas.
First, we need to check if the line and the polygon are separated. Now, the Jordan curve separation theorem says that the polygon divides the plane into exactly two open (and thus non-compact) regions. Thus, the line lies completely inside the polygon, the line lies completely outside the polygon, or possibly (but this will rarely happen) the line intersects the polyon.
Now, the phrasing of this question says "if a line intersects a polygon", so this is a decision problem. One possibility (the decision model approach) is to reduce the question to some other (well known) problem Q, and then try to solve Q. An answer to Q gives an answer to the original decision problem.
In recent years, many geometric problems have been successfully modeled in a new language called PostScript. (See "PostScript Language", by Adobe Systems Incorporated, ISBN # 0-201-10179-3, co. 1985).
So, given a line L and a polygon P, we can write a PostScript program that draws the line L and the polygon P, and then "outputs" the answer. By "output", we mean the program executes a command called "showpage", which actually prints a page of paper containing the line and the polygon. A quick examination of the paper provides an answer to the reduced problem Q, and thus the original problem.
There are two small problems with this approach.
(1) There is an infinite number of ways to encode L and P into the reduced problem Q. So, we will be forced to invoke the Axiom of Choice (or equivalently, Zorn's Lemma). But the use of the Axiom of Choice is not regarded in a very serious light these days.
(2) More importantly, the question arises as to whether or not the PostScript program Q will actually output a piece of paper; or in other words, will it halt?
Now, PostScript is expressive enough to encode everything that a Turing Machine might do; thus the halting problem (for PostScript) is undecidable. It is quite possible that the original problem will turn out to be undecidable.
I won't even begin to go into other difficulties, such as aliasing, finite precision and running out of ink, paper or both.
A couple of references might be:
1. Principia Mathematica. Newton, I. Cambridge University Press, Cambridge, England. (Sorry, I don't have an ISBN# for this).
2. An Introduction to Automata Theory, Languages, and Computation. Hopcroft, J and Ulman, J.
3. The C Programming Language. Kernighan, B and Ritchie, D.
4. A Tale of Two Cities. Dickens, C.
________
From<EMAIL_ADDRESS>(Tom Duff) Summary: Overkill. Organization: AT&T Bell Laboratories, Murray Hill NJ
The situation is not nearly as bleak as Baraff suggests (he should know better, he's hung around The Labs for long enough). By the well known Dobbin-Dullman reduction (see J. Dullman & D. Dobbin, J. Comp. Obfusc. 37,ii: pp. 33-947, lemma 17(a)) line-polygon intersection can be reduced to Hamiltonian Circuit, without(!) the use of Grobner bases, so LPI (to coin an acronym) is probably only NP-complete. Besides, Turing-completeness will no longer be a problem once our Cray-3 is delivered, since it will be able to complete an infinite loop in 4 milliseconds (with scatter-gather.)
________
From<EMAIL_ADDRESS>(David Baraff)
Well, sure its no worse than NP-complete, but that's ONLY if you restrict yourself to the case where the line satisfies a Lipschitz condition on its second derivative. (I think there's an '89 SIGGRAPH paper from Caltech that deals with this).
back to contents


CrypTool implements classic as well as modern methods of cryptography and cryptanalysis. A graphical user interface provides convenient access to these methods, so that they can easily be executed and tested. This allows a quick introduction and gives a better understanding for the possibilities and limitations of certain cryptographic methods.
A definition of cryptology can be found here. An overview of the methods implemented in CrypTool is available on the starting page.
The first figure gives an overview of aims and components of cryptology, and how CrypTool supports this.
The second figure shows how cryptology can be seen within a broader context from a company or government as well as from a science perspective and how it is linked to the higher ranking areas of IT security, risk management and mathematics and computer science.
A basic understanding of cryptology is necessary to take appropriate measures and controls in order to achieve the objectives of IT security (authentication, confidentiality, integrity, non-repudiation) with an optimal cost-value ratio.
IT security describes a broad range of activities to support the usage of IT systems with security measures in order to provide a protection of electronic information for the corporation, clients and external partners. The objective is to protect sensitive information and processes as well as to minimise any IT related disturbances of business operations.
The measures of IT security include (besides cryptology methods) e.g. security organization, legal aspects, security monitoring, anti virus measures, patch management, disaster recovery, business continuity, security architectures and awareness for IT security. A good overview of these measures can be found at NIST or at the German information security agency (http://www.bsi.bund.de/).
Risk management extents the scope of IT security and covers the socially desirable protection of critical infrastructures.
Risk management can be defined as the consciously management of risks. This can include general operational risks or specific financial risks.
Companies, organizations and individuals must deal with all sorts of risks within living memory. The origin of a systematic risk management is based in the financial industry. Today several laws contribute and aim to provide financial control and transparency for corporations (e.g. KonTraG, Sarbanes-Oxley Act or Basel II).
The total risk of a company can be divided into operational risks (e.g. breakdown or limitations of IT systems) or all sorts of financial risks (credit risks, liquidity risks, market risks, liability risks etc.).
Several approaches exist to identify, measure, monitor and control risks.
Risk management does not necessarily aim at complete risk prevention. Instead it tries to identify appropriate actions under a cost and benefit perspective (appropriate measures could also include the insurance of certain risks).
Sources:


Hey I am Aleksandra, I work for Code School and I love writing Code!
I enjoy writing front-end code with these technologies
The easiest way to contact me is via twitter: @mamriarti


| 027:061 Khan | : |
Is not He (better than your gods) Who has made the earth as a fixed abode, and has placed rivers in its midst, and has placed firm mountains therein, and has set a barrier between the two seas (of salt and sweet water).Is there any ilah (god) with Allah? Nay, but most of them know not. |
| 027:061 Maulana | : |
Or, Who made the earth a resting-place, and made in it rivers, and raised on it mountains, and placed between the two seas a barrier? Is there a god with Allah? Nay, most of them know not! |
| 027:061 Pickthal | : |
Is not He (best) Who made the earth a fixed abode, and placed rivers in the folds thereof, and placed firm hills therein, and hath set a barrier between the two seas? Is there any Allah beside Allah? Nay, but most of them know not! |
| 027:061 Rashad | : |
Who is the One who made the earth habitable, caused rivers to run through it, placed on it mountains, and created a barrier between the two waters? Is it another god with GOD? Indeed, most of them do not know. |
| 027:061 Sarwar | : |
"(Are the idols worthier or) the One who has made the earth a resting place, the rivers flow from its valleys, the mountains as anchors and a barrier between the two seas? Is there any lord besides God? In fact, most people do not know. |
| 027:061 Shakir | : |
Or, Who made the earth a restingplace, and made in it rivers, and raised on it mountains and placed between the two seas a barrier. Is there a god with Allah? Nay! most of them do not know! |
| 027:061 Sherali | : |
Or, Who made the earth a place of rest, and placed rivers in its midst, and placed upon it firm mountains, and put a barrier between the two waters? Is there a god with ALLAH? Nay, most of them know not. |
| 027:061 Yusufali | : |
Or, Who has made the earth firm to live in; made rivers in its midst; set thereon mountains immovable; and made a separating bar between the two bodies of flowing water? (can there be another) god besides Allah? Nay, most of them know not. |
Concepts/Themes Covered: أركان الإسلام > التوحيد > توحيد الله تعالي > تقريع من لا يقر بوحدانيته سبحانه Pillars of Islam> Islamic> Oneness of Allah>Scolding who does not Acknowledge his Glory Oneness أركان الإسلام > التوحيد > توحيد الله تعالي > وحدانيته Pillars of Islam> Islamic> Oneness of Allah> Singularity and Being Unique العلوم والفنون > الحقائق العلمية و الإشاة إلى وقائع أيدتهاالإكتشافات العلمية > الإشارة إلى طبقات الأرض Science and Art> The Scientific Facts and the Indication to Facts which have been supported by the Scientific Discoveries>Indication to the Earth Strata العلوم والفنون > الحقائق العلمية و الإشاة إلى وقائع أيدتهاالإكتشافات العلمية > البحر Science and Art> The Scientific Facts and the Indication to Facts which have been supported by the Scientific Discoveries>The Sea العلوم والفنون > الحقائق العلمية و الإشاة إلى وقائع أيدتهاالإكتشافات العلمية > الجبال Science and Art> The Scientific Facts and the Indication to Facts which have been supported by the Scientific Discoveries>The Mountains
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


LocalStorage management wrapper for reduxables like redux-async.
npm i @weavedev/redux-local-storage
We generate API documentation with TypeDoc.
In this example we wrap a ReduxAsync object in a ReduxLocalStorage object to save state changes to localStorage and load existing state from localStorage on init.
import { ReduxAsync } from '@weavedev/redux-async';
import { ReduxLocalStorage } from '@weavedev/redux-local-storage';
export const storedResource = new ReduxLocalStorage(new ReduxAsync( ... ), 'localStorageKey');
// If you are also using our store package (@weavedev/store)
window.storeReducers.storedResource = storedResource.reducer;
window.storeSagas.storedResource = storedResource.saga;
declare global {
interface StoreReducersMap {
storedResource: typeof storedResource.reducer;
}
interface StoreActionsMap {
storedResource: typeof storedResource.actions;
}
}
You can change the saving behaviour by providing an options object.
export const storedResource = new ReduxLocalStorage(
new ReduxAsync( ... ),
'localStorageKey',
reduxLocalStorageOptions,
);
{
/**
* Add a custom transformer between localStorage and the runtime state.
* Usefull for objects that can not be serialized.
*/
transform: {
// Convert saved state to runtime state
read: (s: string): MyAsyncState => ({ data: s }),
// Convert runtime state to saved state
write: (s: MyAsyncState): string => s.data,
},
/**
* By default ReduxLocalStorage saves to localStorage whenever the state changed.
* If you only want to save on specific action types you can provide an array.
*/
triggers: ['MY_ASYNC_ACTION_TRIGGER', 'MY_ASYNC_ACTION_CALLBACK'],
}
Made by Paul Gerarts and Weave
Generated using TypeDoc