Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 Q:Managed Dx9, Sprite.Draw, Billboard ???

Note: You must be registered in order to post a reply.

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List Spell Checker
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

   Insert an File
Check here to include your profile signature.
Check here to subscribe to this topic.
    

T O P I C    R E V I E W
DxDotNet Posted - Sep 02 2005 : 07:08:25 AM
--------English/Englisch-------------

Hi All,

has anyone used Sprite.Draw of Managed DX9 to build a billboarding-function or used it in any other way in 3D?

I want to solve the following two problems:

1.) I do not know how to configure the view matrix correctly. I use a identity matrix as world matrix and I implemented a fully functionally 1st Person 3D world with camera rotation by mouse, meshes etc.
Everything works great that far, except billboarding. I like to use Sprite.Draw, because of its abillity to select regions from the bitmap-source (texture), its fast, and it should do it.
But if I rotate my view, the Billboard-Sprite changes its position and comes nearer. What's my fault? Any Idea

2.) There are two parameters in Sprite.Draw (Center and Position). What do they do? I tried different values, but it was impossible for me to position the Billboard Sprite at the correct place.

If anyone has any experiences, oder knows a website where to look further (Microsoft MSDN is not very helpful in this case) or is able to post a code sample. That were great!

Thank You all.

So long,

Holger



A Codesample is attached at the end of the Text.


--------Deutsch/German-------------

Hallo Leuz,

hat jeder von Euch schon mal mit dem Sprite.Draw von Managed DX9 die Billbord-Funktion benutzt?

Ich habe folgende zwei Probleme:

1.) Ich schaffe es nicht die View-Matrix richtig anzugeben. Ich verwende als WorldMatrix einfach die Einheitsmatrix und übergebe schlicht die ViewMatrix (1stPerson-Kamerapos., berechnet über Maus die Drehung etc, läuft problemlos als 3D-Welt mit Meshes).
Das Sprite sehe ich zwar auch, aber es verhält sich nicht richtig wie ein Billboard, sondern ändert die Position bei Kameradrehung (kommt auf die Kamera zu).

2.) Die beiden Vektoren-Parameter der Sprite.Draw (Center und Position). Welche Funktion erfüllen Sie? Ich habe damit experimentiert und kommen zu keiner sinnvollen Positionierung des Sprites.

Wenn jemand einen Tip hat, wo es hierzu paar sinnvolle Infos, oder Codebeispiele gibt, wäre das klasse . Bei Microsoft (MSDN) gibts nämlich nix.

Gruß,

Holger


Codebeispiel (Codesample), zur Frage:


Dim s As New Direct3D.Sprite(Device)
Try
s.SetWorldViewLH(Device.Transform.World, Device.Transform.View)

s.Begin(Direct3D.SpriteFlags.AlphaBlend Or Direct3D.SpriteFlags.Billboard)
s.Draw(AniTexture, New Rectangle(0, 0, 256, 256), New Vector3(x, y, z), New Vector3(x2, y2, z2), Color.White)
s.End()
Finally
s.Dispose()
End Try

VBGamer © Go To Top Of Page
This page was generated in 0.05 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.