Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 8th Nov 2009 08:22
Hello All,
I just bought Dark video, and need a little help with programming it. Here is my question; Is it possible to load more then one video in a room of 6 monitors and the video only runs one at a time on a monitor when the player clicks on it?

If this is possable could someone give me a example code to get started.

Thank you,

Here i am!!!
Deep Cove Software
16
Years of Service
User Offline
Joined: 13th Jul 2009
Location: United Kingdom
Posted: 8th Nov 2009 13:43 Edited at: 8th Nov 2009 13:45
Hi,

You can load multiple movies with Dark Video. All the code that you need is in the sample. Basically, you just need to store the handle you receive from opening a movie and then call operations on that handle.

For example, if you need six movies, you'd call 'darkvideo open movie' six times and store the six handles. You'd then need six unique textures to decode the movies to. The sample shows how to create a texture from an opened movie's dimensions. For convenience, the code's shown here:

movieId = darkvideo open movie( "sample.dvf" )
movieWidth = darkvideo get movie width( movieId )
movieHeight = darkvideo get movie height( movieId )

make memblock memBlockId, movieWidth * movieHeight * 4 + 12
write memblock dword memBlockId, 0, movieWidth
write memblock dword memBlockId, 4, movieHeight
write memblock dword memBlockId, 8, 32
make image from memblock imageId, memBlockId
delete memblock memBlockId

You could wrap the above code into a function (can't remember what they're called in DBP) and pass in an arbitrary movie name and image id so after opening, you have a unique movie associated with a unique texture. It's important you have a unique image id for every movie you open.

Then, whenever someone clicks on the monitor (you'd need to texture the screen with the texture you created and which the movie is decoding to), you can control the movie with the following calls:

result = darkvideo play movie( movieId, imageId, 1, 0 )
result = darkvideo stop movie( movieId )
result = darkvideo close movie( movieId )

You should just stop the movie if you want to play it again at some point (it'll stop automatically if loop is not specified; see 'dark video play movie' for info on looping). Closing it will free the movie up which may not be what you need until the end.

Lastly, although Dark Video 2 is due out within the next two weeks, there's an alpha version out (see the main Dark Video thread on page 3 I think) that introduced a few new important commands.

I hope this helpful. The documentation has info on the various calls (it's quite a simple set really) and the sample really contains everything you need. We'll be making some more samples for Dark Video 2 that should be a lot better to use as a basis for projects.
Deep Cove Software
16
Years of Service
User Offline
Joined: 13th Jul 2009
Location: United Kingdom
Posted: 8th Nov 2009 16:08
Just a note to say we'll make a sample that plays multiple movies for Dark Video 2, out within the next week or two. And as a reminder, Dark Video 2 is a free upgrade to registered users of the current Dark Video.
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 9th Nov 2009 05:02
Humm, I am starting to understand a little better.
However this make more questions for me. So the object is made from the video size correct? So if i have 6 monitors in a room i can't just use the model for imageID. I have to come up with a way to load and adjust with programming each object in from the monitor model right?


Is this correct?

thank you,

Here i am!!!
Deep Cove Software
16
Years of Service
User Offline
Joined: 13th Jul 2009
Location: United Kingdom
Posted: 9th Nov 2009 15:52
Quote: "However this make more questions for me. So the object is made from the video size correct?"


If by object, you mean your screen that you want to click, then no, it's the actual texture that's made from the video size. Dark Video only understands decoding to a texture.

Quote: "So if i have 6 monitors in a room i can't just use the model for imageID. I have to come up with a way to load and adjust with programming each object in from the monitor model right?"


You can't just pass a model id in because Dark Video has no concept of decoding to a 3d object or model. It can only decode to a texture.

But, if you just wanted to play the movie onto an object, you can tell the object the texture to use with the following command:

TEXTURE OBJECT <object id>, <image id>

However, you're still responsible for creating the texture(s) in the first place. We offload this responsibility to the user because if we start creating images with various ids, it stands a good chance the user will create images with the same ids. This would lead to a lot of heartache and confusion.

Now, I don't know for sure but maybe someone who's really good with DBP can let you know whether it's possible to assign a texture to a polygon within an object. Then, once you'd created your texture, it'd be a simple matter of texturing that one polygon within your screen model.

Anyway, we'll make a sample that shows multiple videos playing that you can click to stop and start.

Also, we've found a few issues with multiple playback that are now resolved for Dark Video 2.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 9th Nov 2009 16:24
You should create your TVs with the screen as a separate limb, then use:
Texture Limb ObjId, LimbId, ImageId
to draw the video onto the screen.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
Deep Cove Software
16
Years of Service
User Offline
Joined: 13th Jul 2009
Location: United Kingdom
Posted: 9th Nov 2009 17:48
@Mobiius - Thanks for that! Thought there'd be a command like this floating around somewhere.
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 12th Nov 2009 20:07
Thanks for the responce guys, Please i am new to game programming,
and it taken a little bit to sink in with out a code example for me.


So i have 6 monitors the screens will be six obects out side of my model. So with trial and error i have to make these six screens fit on the out side of the models and manualy justing X,Y,Z movements to get the screens i am going to show the video on.

Does that sum it up.

Also Deep Cove, I have Dark DGK installed and programming in it do you have any other example code for the DGK?

ALso i bought the software here on thegamecreators.com. SO when is your version two comming out. I am really needing the get my videos up and running A.S.A.P.

Thank you All,
leroy

Here i am!!!
Deep Cove Software
16
Years of Service
User Offline
Joined: 13th Jul 2009
Location: United Kingdom
Posted: 13th Nov 2009 10:53
Yeah, what you really want is the screen of your monitor/tv object to be a child object. Then, after you've created a texture to decode a movie to, you simply assign the texture to that child object.

You might want to look around the forums for tips on how to bring in your object and get at a child object. There's a lot of very knowledgeable Dark BASIC users on this board. Maybe you'll be able to find a post by VanB or IanM that will be able to help you, regarding how to get at a child object.

We're on target to release Dark Video 2 on November 27th 2009. Also, if you have a look where Dark Video installed to, you'll find documentation and a sample project for Dark GDK.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Nov 2009 13:25
Do it in your modelling software. Just make sure that the screen is a limb, then use the texture limb command to put your texture on it.

It really is as simple as that.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 13th Nov 2009 17:34
Ok, does mean i name the object screen limb in the software.

I am currently using maya 2009.

Leroy

Here i am!!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Nov 2009 18:42
You can name it whatever you want, as in DBPro you'll be using it's limb number anyway. (But it's name can help you ascertain the correct number when you're looking for it)

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 13th Nov 2009 20:52
Hello again,
Thank you for responding.

I need a little more help in understanding how to do this.
Made a monitor model and i am uploading to the site for the example code. So when you mean limb i pushed the screen out side the model. Load the monitor9.x file and you can see what i mean.


How do i make this little screen out side my model a limb with a id?

Thank you

Here i am!!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Nov 2009 21:05
I don't have any modelling software, but construct the case using one primitive, and the screen with another. Then glue it as a limb.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 13th Nov 2009 21:16
Please have a look at the model... It's directx format.

If you are programing in TGC you will have the viewer installed...
It's a directx file.

I did make the monitor one object and the screen is a second one moved out 10 metters out.

Let me know what you think

Here i am!!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 13th Nov 2009 22:33
Then use the limb name$( Obj, Limb ) command to find the correct limb by name.

If your object is 2 limbs, then they will be limb 1 and limb 2.
And I don't have the viewer installed as I'm on my new works laptop and haven't installed DBPro on it yet.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 14th Nov 2009 02:38
Hello Mobiius,
I was reading the limb command in the help file and how to use it.
Never saw an example to use two mesh's to add a limb.

Sure wish you had directx sdk install would help alot. However
i have the model monitor made then added a screen about 10 mm out in front of it. When i use the limb command does that mean trial and error to get the screen to show up right connected to the mesh model?

let me know,
Leroy

Here i am!!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Nov 2009 15:58
You don't need two objects. You add the screen as a limb in your modelling software, not in DBPro.

You just reference the screen limb in DBPro and texture it.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 14th Nov 2009 19:48
See this what i don't understand. Because in a message just a few posts up the page. You said name the ojbects anything i want just find them. Now your saying name them in the software.

I am totaly lost now......


When i export my models from maya to .X format everything becomes one object right.... Because it loads in the directx viewer that way.

Do you have a example you could show me with code and a model...

Thank you,
leroy

Here i am!!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 14th Nov 2009 20:08 Edited at: 14th Nov 2009 20:08
Quote: "You said name the ojbects anything i want just find them."

That's right, you name each limb whatever you want in your modelling software.

Quote: "When i export my models from maya to .X format everything becomes one object right"

That's right. And unless you check the save as one object option (or similar) your object will be made up of a number of limbs.

Using their names, you can find them using the checklist commands to get the correct limb number, then texture it.

Quote: "Do you have a example you could show me with code and a model..."

No I don't sorry, as I said, I don;t have anything like that installed on my laptop.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 20th Nov 2009 11:11
Hello mobiius,
I now have the limbs working from maya 2009...
Just so you know it's making bones in the model and the limbs are the bones in the problem. SHould make a tutorial for here.


Anyway now i have the limbs working how do i get the texter to show on the second limb 2 now.. Thank you,
Example code please.

Leroy

Here i am!!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 20th Nov 2009 13:56
Quote: "Posted: 13th Nov 2009 12:25"

Do it in your modelling software. Just make sure that the screen is a limb, then use the texture limb command to put your texture on it.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
3dmasters
16
Years of Service
User Offline
Joined: 3rd Nov 2009
Location:
Posted: 20th Nov 2009 23:53
Mobiius,

Is testure the same as loading a imageID?
So can LOAD IMAGE MYTEXTURE.jpg, 1

TextureID = 1 now?

Is this right?

Thank you,

Here i am!!!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 23rd Nov 2009 18:49
Yes.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)

Login to post a reply

Server time is: 2026-06-11 21:22:59
Your offset time is: 2026-06-11 21:22:59