Download CS 497: Computer Graphics

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
CS 497: Computer
Graphics
James Money
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
Graphics Databases
In order to store all information about
polygon, objects, color information, and
textures, we will need a database.
– This allows us to modify an existing text
file, or a Database using SQL to change
our world and gives us an easy way to get
the information about our world into the 3D
graphics system.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
Organization of the DB
Four our database for our polygons and
object composed of polygon meshes,
we will be using an object oriented
method for storage, much like a record
in a database.
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
Organization of the DB
• At the lowest level we would want a
polygon with a list of points defined.
• After we define this polygon, we can
include it in many other objects.
• The most upper level objects might be
considered rooms.
• These objects “Rooms” would combine
to make up the world.
• We would probably have lights too!
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
Organization of the DB
Object 1
Object 3
A Room
Polygon 1
A Cube
Object 2
Polygon 2
Polygon 3
A Wall in a Room
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
Organization of the DB
Light 1
Object 1
The
World
Object 3
A Room
Polygon 1
A Cube
Object 2
Polygon 2
Object 4
Another Room
Polygon 3
A Wall in a Room
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
What attributes would a
polygon have?
• The number of
points in the
polygon.
• The 3D points it has.
• Ka
• Kd
• Ks
• The shading method
• The object’s color
• The object’s
specular color
• Texture filename
and Texture Points.
File has in it:
– width (int)
– height (int)
– data as array of 3
bytes of RGB
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
What would an object
contain?
• A list of polygons
• A list of other
objects it contains
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
What would a light
have?
• The color of the light
• The values of for fatt:
– C1
– C2
– C3
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.
What would a world
have?
• A light of polygons
with:
– Rotation
– Scaling
– Translating
• A list of objects with:
• A list of lights with:
– The position
• The World Ambient
light level
– Rotation
– Scaling
– Translating
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may be
reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the author.