Skip to main content
gamedev.net
🔒 Locked

Attach Object...

Started by joshfly Mar 5, 2004 at 9:19 AM 6 replies 500+ views
Original Post
joshfly
joshfly
How can i attach two objects together...i want to attach a door and windows with the door... how should i do it?
superdeveloper
superdeveloper
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.
joshfly
joshfly
is OpenGL...
any example code?? im new in OpenGL...i want to attach a door and windows to the wall (sorry...not door)
chowe6685
chowe6685
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.
Tree Penguin
Tree Penguin
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]
joshfly
joshfly
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~
joshfly
joshfly
sorry, i dun understand...what you suggestion is good but can i have some sample of code to refer??

Thanks alot =)
Tree Penguin
Tree Penguin

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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.