FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

yage.resource.model

 
Post new topic   Reply to topic     Forum Index -> Yage
View previous topic :: View next topic  
Author Message
Deformative



Joined: 27 Jan 2007
Posts: 13

PostPosted: Sun Feb 04, 2007 8:50 pm    Post subject: yage.resource.model Reply with quote

I am confused on how to use this class. It doesn't appear to accept more than 4 vertices. If you could provide a detailed explanation on how to use this module I would appreciate it.

From SpriteNode I have learned a bit, but hardly anything.
Back to top
View user's profile Send private message AIM Address
JoeCoder



Joined: 29 Oct 2005
Posts: 294

PostPosted: Mon Feb 05, 2007 11:41 am    Post subject: Reply with quote

You can bascially call addVertex() multiple times to add as many as you need. Models have an array of meshes, which in turn each have a material and arrays of triangles. Each triangle stores the indexes of three vertices of the model needed to define that triangle. Having the data in this format reduces the amount of memory a model consumes and also allows optimal rendering speed for OpenGL VBO's.

In the latest svn, take a look at yage.system.render.Render.generate(). It generates a cube using only Model's public methods. node.graph.graphNode also uses model, but via its fields. Perhaps resource.model could use a better interface (and certainly better documentation). I'll put that next on my list and maybe even get to it this evening. I'll keep you posted.

As for SpriteNode's use of Model, that has now been refactored into yage.system.redner as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Yage All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group