Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Loading a 3d object just giving 3 of its coordinates.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD User Game Projects
View previous topic :: View next topic  
Author Message
tirengarfio
Member


Joined: 08 Aug 2006
Posts: 1

PostPosted: Tue Aug 08, 2006 10:07 am    Post subject: Loading a 3d object just giving 3 of its coordinates. Reply with quote

Hi,

im trying to write a code that loads a 3d model into a Vc++/Opengl application.

I would like to set the 3d object, just giving the position to three of its coordinates

I mean, if my 3d object is a cube of 2x2x2, I would like to set the coordinate (0,0,0) of the cube in some position of space OpenGL, the coordinate (2,0,0) in another position of the space, and the coordinate (0,2,0) in another position.

Someone told me something about DMF loader.

Can DMF Loader load the object 3D in the way i have said?

Do you know any other loader that can loads objects in that way?
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Tue Aug 08, 2006 10:38 am    Post subject: Reply with quote

Hi there tirengarfio, and welcome! Smile

I'm not really sure what you're trying to achieve, but I think you just want to place the loaded object at some particular position in 3D worldspace, right? If so, you can just add that position to all vertices in your object. For example, if you want to place your object at 10,4,5, then do something like:

Code:

for i = 0 to numvertices-1 do
  vertex = GetVertex(i)
  vertex.x = vertex.x + 10
  vertex.y = vertex.y + 4
  vertex.z = vertex.z + 5
end
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tirengarfio
Member


Joined: 08 Aug 2006
Posts: 1

PostPosted: Tue Aug 08, 2006 10:53 am    Post subject: Reply with quote

GetVertex is a function from DMF Loader?
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Tue Aug 08, 2006 11:00 am    Post subject: Reply with quote

I'm not familiar with the DMF loader (I write my own loaders for DeleD Laughing). You will have to store your vertices in some way. Arrays for example. A function like GetVertex simply gets a vertex from a specific position from such array.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD User Game Projects All times are GMT
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