Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Gradients
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Carey




PostPosted: Fri Jul 04, 2008 3:32 pm   Post subject: Gradients

Hey everyone. I am working an a 3D model editor and I want to display the model using shading based on lighting. I have all the formulas and infrastructure needed to display the model, but i cant figure out how to make an array of colors that make up a gradient from black to the base color of the model to white. I know that in order to do this I need to make 2 gradients: one from black to the base color and the other from the base color to white. I have tried looking through the Java API, but it seems all there is is the built-in class for painting shapes with a gradient. Does anyone know a formula or segment of code that will accomplish this task?
Sponsor
Sponsor
Sponsor
sponsor
Carey




PostPosted: Sun Jul 13, 2008 4:34 pm   Post subject: RE:Gradients

***BUMP***

Wow, Java threads are dead. Anyone?
btiffin




PostPosted: Sun Jul 13, 2008 9:15 pm   Post subject: RE:Gradients

REBOL uses the AGG (Anti-Grain Geometry) graphics library. Open source. Check
http://www.antigrain.com/demo/index.html#PAGE_DEMO_gradients

And the main site. http://www.antigrain.com/index.html

If the 2D code doesn't map well for you, then I'd poke around Orge3D or Horde3D sources. Bound to find a gradient source code example.

Cheers
DemonWasp




PostPosted: Mon Jul 14, 2008 8:19 am   Post subject: RE:Gradients

I think you need to be more specific about what existing technology you're using. If you're rolling your own 3d engine, then there's little chance you'll find the help you need here - you'll need to get a book. If you're using an existing 3d engine (for example, http://www.jmonkeyengine.com/ ), then you're probably better off asking on their forums.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: