• Advertisement

Archived

This topic is now archived and is closed to further replies.

Attach Object...

This topic is 5104 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can i attach two objects together...i want to attach a door and windows with the door... how should i do it?

Share this post


Link to post
Share on other sites
Advertisement
Is tis Open GL or NeHe specific?

You can create a pointer in Door that you will assign teh window address. Now the door has access (thus connected?) to the window. Vice-versa if necessary.

Share this post


Link to post
Share on other sites
is OpenGL...
any example code?? im new in OpenGL...i want to attach a door and windows to the wall (sorry...not door)

Share this post


Link to post
Share on other sites
Opengl doesn''t see objects, it sees polygons. If you want a door and window and wall, you need to draw and door and window and wall using polygons.

Share this post


Link to post
Share on other sites
Well, first of all, translate to the point on which the doors/windows are connected to the walls,
then rotate (as that's probably what you want), then translate to the point the origin of the door/window should be and draw the door/window.

Am i clear?

[edited by - Tree Penguin on March 5, 2004 10:37:32 AM]

Share this post


Link to post
Share on other sites
i know...i got a house, now just want to know how to attach a door and windows to the wall only...(i drawed door and windows as well)

Thanks~

Share this post


Link to post
Share on other sites
sorry, i dun understand...what you suggestion is good but can i have some sample of code to refer??

Thanks alot =)

Share this post


Link to post
Share on other sites

red=door/window origin, green=the point where the door/window is connected to the wall.

1. draw the wall

this is per moving object:

2. translate (move) to the connection point
3. rotate a certain amount (so the door/window is open, not closed)
4. translate the amount (door/window origin - connection point)
5. draw the door/window

Share this post


Link to post
Share on other sites

  • Advertisement