Search Results

Search found 15231 results on 610 pages for 'presentation model'.

Page 27/610 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Light on every model and not in the whole scene

    - by alecnash
    I am using a custom shader and try to pass the effect on my Models like that: foreach (ModelMesh mesh in Model.Meshes) { foreach (ModelMeshPart part in mesh.MeshParts) { part.Effect = effect; } mesh.Draw(); } My only issue is that every Model now has its own light source in it. Why is this happening and is this a problem of my shader? Edit: These are the parameters passed to the shader: private void Get_lambertEffect() { if (_lambertEffect == null) _lambertEffect = Engine.LambertEffect; //Lambert technique (LambertWithShadows, LambertWithShadows2x2PCF, LambertWithShadows3x3PCF) _lambertEffect.CurrentTechnique = _lambertEffect.Techniques["LambertWithShadows3x3PCF"]; _lambertEffect.Parameters["texelSize"].SetValue(Engine.ShadowMap.TexelSize); //ShadowMap parameters _lambertEffect.Parameters["lightViewProjection"].SetValue(Engine.ShadowMap.LightViewProjectionMatrix); _lambertEffect.Parameters["textureScaleBias"].SetValue(Engine.ShadowMap.TextureScaleBiasMatrix); _lambertEffect.Parameters["depthBias"].SetValue(Engine.ShadowMap.DepthBias); _lambertEffect.Parameters["shadowMap"].SetValue(Engine.ShadowMap.ShadowMapTexture); //Camera view and projection parameters _lambertEffect.Parameters["view"].SetValue(Engine._camera.ViewMatrix); _lambertEffect.Parameters["projection"].SetValue(Engine._camera.ProjectionMatrix); _lambertEffect.Parameters["world"].SetValue( Matrix.CreateScale(Size) * world ); //Light and color _lambertEffect.Parameters["lightDir"].SetValue(Engine._sourceLight.Direction); _lambertEffect.Parameters["lightColor"].SetValue(Engine._sourceLight.Color); _lambertEffect.Parameters["materialAmbient"].SetValue(Engine.Material.Ambient); _lambertEffect.Parameters["materialDiffuse"].SetValue(Engine.Material.Diffuse); _lambertEffect.Parameters["colorMap"].SetValue(ColorTexture.Create(Engine.GraphicsDevice, Color.Red)); }

    Read the article

  • Separate collision mesh model?

    - by Menno Gouw
    I want to have another go at 3D within XNA. What I have seen from some other games that they just have a separate very low poly model "cage" around the environment model. However I can not find any reference to this. I have not that much experience with XNA 3D either. Is it possible to have this cage within each of my environmental models already? Lets just say I call the mesh within the .FBX wall and col_wall. How would I call to these different meshes within XNA? The player would just have a tight collision cube around. To make it a bit more efficient I will be making divide the map up by cubes and only calculate collision if the player is in it. Question two: I can't find anywhere to do cube vs mesh collision. Is there a method for this? Or perhaps it is possible to build my collision cage out of cubes in the 3D app and on loading of the models in XNA replace them directly by cubes? So I could just do box to box collision which should be very cheap and still give the player the ability to move over ledges on the static models.

    Read the article

  • Common way to store model transformations

    - by redreggae
    I ask myself what's the best way to store the transformations in a model class. What I came up with is to store the translation and scaling in a Vector3 and the rotation in a Matrix4. On each update (frame) I multiply the 3 matrices (first build a Translation and Scaling Matrix) to get the world matrix. In this way I have no accumulated error. world = translation * scaling * rotation Another way would be to store the rotation in a quaternion but then I would have a high cost to convert to a matrix every time step. If I lerp the model I convert the rotation matrix to quaternion and then back to matrix. For speed optimization I have a dirty flag for each transformation so that I only do a matrix multiplication if necessary. world = translation if (isScaled) { world *= scaling } if (isRotated) { world *= rotation } Is this a common way or is it more common to have only one Matrix4 for all transformations? And is it better to store the rotation only as quaternion? For info: Currently I'm building a CSS3D engine in Javascript but these questions are relevant for every 3D engine.

    Read the article

  • Can't load model using ContentTypeReader

    - by Xaosthetic
    I'm writing a game where I want to use ContentTypeReader. While loading my model like this: terrain = Content.Load<Model>("Text/terrain"); I get following error: Error loading "Text\terrain". Cannot find ContentTypeReader AdventureGame.World.HeightMapInfoReader,AdventureGame,Version=1.0.0.0,Culture=neutral. I've read that this kind of error can be caused by space's in assembly name so i've already removed them all but exception still occurs. This is my content class: [ContentTypeWriter] public class HeightMapInfoWriter : ContentTypeWriter<HeightmapInfo> { protected override void Write(ContentWriter output, HeightmapInfo value) { output.Write(value.getTerrainScale); output.Write(value.getHeight.GetLength(0)); output.Write(value.getHeight.GetLength(1)); foreach (float height in value.getHeight) { output.Write(height); } } public override string GetRuntimeType(TargetPlatform targetPlatform) { return "AdventureGame.World.Heightmap,AdventureGame,Version=1.0.0.0,Culture=neutral"; } public override string GetRuntimeReader(TargetPlatform targetPlatform) { return "AdventureGame.World.HeightMapInfoReader,AdventureGame,Version=1.0.0.0,Culture=neutral"; } } Does anyone meed that kind of error before?

    Read the article

  • Internationalization messages based in views or in model entities

    - by SJuan76
    I have a small webapp in java and I am adding the internationalization support, replacing texts with labels that are defined in dictionary files. While some texts are obviously unique to each view (v.g. the html title), other refer to concepts from the model (v.g. a ticket, the location or status of such ticket, etc.) As usual, some terms will appear many times in different locations (vg, in both the edition page and in the search page and in the listings I have a "ticketLocation" label). My question is: can I organize the labels around the model concepts (so I have a ticket.location label and I use it everywhere such field is labeled) or should I make a different label for each (so form.ticketLocation and filter.ticketLocation and list.ticketLocation). I would go for the first option; I have searched for tips and the only thing that I see that could hinder me is due to the length of the string disrupting the design, and even for that I would prefer having to add a ticket.locationShort for places where there is not much space. What is your opinion/tips/experience?

    Read the article

  • Data model for unlockable card collection

    - by Karlos Zafra
    My game has a collection of cards (about 64) that are unlocked (one by one) provided that 4 items are collected/gained in the game. Right now the deck of cards is modeled with a plist file, like this: <plist> <dict> <key>card1</key> <dict> <key>available</key> <true/> <key>series</key> <integer>1</integer> <key>model</key> <integer>1</integer> <key>color</key> <integer>1</integer> </dict> <key>card2</key> <dict> <key>available</key> <false/> <key>series</key> <integer>1</integer> <key>model</key> <integer>1</integer> <key>color</key> <integer>2</integer> </dict> The value for the key named "available" marks if the item is locked or not. Right now I have to include the data for the items collected by the user, but including that inside the plist looks like too much hassle. What kind of structure should be more suitable for this? How do you manage a collection of unlockable items like this?

    Read the article

  • ViewModel with SelectList binding in ASP.NET MVC2

    - by Junto
    I am trying to implement an Edit ViewModel for my Linq2SQL entity called Product. It has a foreign key linked to a list of brands. Currently I am populating the brand list via ViewData and using DropDownListFor, thus: <div class="editor-field"> <%= Html.DropDownListFor(model => model.BrandId, (SelectList)ViewData["Brands"])%> <%= Html.ValidationMessageFor(model => model.BrandId) %> </div> Now I want to refactor the view to use a strongly typed ViewModel and Html.EditorForModel(): <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <%=Html.EditorForModel() %> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } %> In my Edit ViewModel, I have the following: public class EditProductViewModel { [HiddenInput] public int ProductId { get; set; } [Required()] [StringLength(200)] public string Name { get; set; } [Required()] [DataType(DataType.Html)] public string Description { get; set; } public IEnumerable<SelectListItem> Brands { get; set; } public int BrandId { get; set; } public EditProductViewModel(Product product, IEnumerable<SelectListItem> brands) { this.ProductId = product.ProductId; this.Name = product.Name; this.Description = product.Description; this.Brands = brands; this.BrandId = product.BrandId; } } The controller is setup like so: public ActionResult Edit(int id) { BrandRepository br = new BrandRepository(); Product p = _ProductRepository.Get(id); IEnumerable<SelectListItem> brands = br.GetAll().ToList().ToSelectListItems(p.BrandId); EditProductViewModel model = new EditProductViewModel(p, brands); return View("Edit", model); } The ProductId, Name and Description display correctly in the generated view, but the select list does not. The brand list definitely contains data. If I do the following in my view, the SelectList is visible: <% using (Html.BeginForm()) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <%=Html.EditorForModel() %> <div class="editor-label"> <%= Html.LabelFor(model => model.BrandId) %> </div> <div class="editor-field"> <%= Html.DropDownListFor(model => model.BrandId, Model.Brands)%> <%= Html.ValidationMessageFor(model => model.BrandId) %> </div> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } %> What am I doing wrong? Does EditorForModel() not generically support the SelectList? Am I missing some kind of DataAnnotation? I can't seem to find any examples of SelectList usage in ViewModels that help. I'm truly stumped. This answer seems to be close, but hasn't helped.

    Read the article

  • AD Stopping a Script and Writing a Value to a User's AD Account PPT Presentation

    - by Steven Maxon
    ‘This will launch the PPT in a GPO Dim ppt Set ppt = CreateObject("PowerPoint.Application") ppt.Visible = True ppt.Presentations.Open "C:\Scripts\Test.pptx" ‘This is the batch file at the end of the PPT that records the date, time, computer name and username echo "Logon Date:%date%,Logon Time:%time%,Computer Name:%computername%,User Name:%username%" >> \\servertest\g$\Tracking\LOGON.TXT ‘This is what I need but can’t find: I need the script to check a value in the Active Directory user’s account in the Web page: attribute that would shut off the script if the user has already competed reading the presentation. Could be as simple as writing XXXX. I need the value XXXX written to the Active Directory user’s account in the Web page: attribute when they finish reading the presentation after they click on the bat file so the script will not run again when they log in.

    Read the article

  • Flash Slide Presentation full screen

    - by Marco
    I am building my very first Flash Slide Presentation. However, I would like to enable full screen when the presentation starts. I placed: fscommand("fullscreen", "true"); In the first layer, first frame, of the first slide. And I use a .html file to launch to embed the .swf file. However, when I open the .html, a popup appears saying: “Adobe Flash Player has stopped a potentially unsafe operation.” What am I doing wrong?

    Read the article

  • MVC model flow?

    - by fuzzygoat
    I am setting up an application using the MVC model and I have a query regrading the flow of information from the UI to the data model. What I need to do is place data from the UI in the model, what I have done is write a method in the view which collects the required data in an object and then passes it to the model. The model then takes ownership of the data so that the view can release its ownership. Does this sound sensible?

    Read the article

  • Table Disobeys W3C Box Model, Ie8 Ignores Fixed Table Width !

    - by Axel Myers
    Hi, I'm having hard time with tables and column widths. Update: I'm using XHTML Strict 1.0. The page is: http://www.pro-turk.net/try The first problem I have is, I have a column with a fixed width of 100px and 4px padding, but it disobeys my padding depending on the value. The column width (as the distance between two borders according to W3C Box Model) is 156 px even if padding is 0 or 4. Only the position of the text changes. According to W3C Box Model ( available at www.pro-turk.net/box_model.png ), borders and paddings aren't included in WIDTH attribute, so why does it render wrongly ? The second problem is, when you look the page I gave with IE8, the first cell in the second row has 150px fixed width, but ie shows it about 50% of the total table width regardless of what i say.

    Read the article

  • Storing GenericForeignKey content_type in another model?

    - by slypete
    I have a typical definition/instance situation in my data modeling. I'm trying to store the content_type of a GenericForeignKey in another model (the definition model) like so: class IndicatorFieldInstance(models.Model): definition = models.ForeignKey(IndicatorField) object_id = models.PositiveIntegerField() content_object = generic.GenericForeignKey(definition.content_type, 'object_id') indicator_instance = models.ForeignKey(IndicatorInstance) I've also tried it like this: content_object = generic.GenericForeignKey('definition__content_type', 'object_id') Neither of these methods seem to work. Is it possible to achieve this? For reference, here's the definition model: class IndicatorField(models.Model): name = models.CharField(max_length='255') content_type = models.ForeignKey(ContentType) indicator = models.ForeignKey(Indicator) Thanks, Pete

    Read the article

  • Show UIView for app presentation only once in iOS

    - by André Muniz
    I need to show an UIScrollView with some pages for present the app to user when launched for the first time. My slides are working correctly, lefting the logic to present it. Is a good practice to set the UIScrollViewController as root controller and set a NSUserDefault variable to control the presentation and redirect to main controller or set the main ViewController as root normally and call the presentation view if needed is a better approach? If there is a better way to do this can someone help? Thanks.

    Read the article

  • Django display manytomany field in form when definition is on other model

    - by John
    Hi I have the definition for my manytomany relationship on one model but want to display the field on the form of my other model. How do I do this? for example: # classes class modelA(models.Model): name = models.CharField(max_length=300) manytomany = models.ManyToManyField(modelA) class modelB(models.Model): name = models.CharField(max_length=300) # forms class modelBForm(forms.ModelForm): class Meta: model = modelB If I then used modelBForm it would show a select box with the models from modelA rather than just name. Thanks

    Read the article

  • Can I create a transaction using ADO NET Entity Data Model?

    - by Junior Mayhé
    Hi is it possible on the following try-catch to execute a set of statements as a transaction using ADO NET Entity Data Model? [ValidateInput(false)] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Customer c) { try { c.Created = DateTime.Now; c.Active = true; c.FullName = Request.Form["FirstName"]; db.AddToCustomer(c); db.SaveChanges(); Log log = new Log();//another entity model object log.Created = DateTime.Now; log.Message = string.Format(@"A new customer was created with customerID {0}", c.CustomerID); db.AddToLog(log); db.SaveChanges(); return RedirectToAction("CreateSuccess", "Customer"); } catch { return View(); } } Any thoughts would be very appreciated.

    Read the article

  • How to map a Entity Data Model conceptual model property to a storage model column using the "Serial

    - by codekaizen
    I have a conceptual model in EDM where one of the entities has a property which is essentially a big value object whose properties aren't really useful as columns in the datamodel. I'd like to apply the Serialized LOB pattern to it so that I can fit it into a 192 byte binary column. How do I map this in the EDM v4? Is it even possible at this time? Actually, is it possible in any ORM?

    Read the article

  • how to save a fitted R model for later use

    - by ahala
    Sorry for this novice question: if I fit a lm() model or loess() model, and save the model somewhere in a file or in database, for later using by third party with predict() method, do I have to save the entire model object? Since returned model object contains orginal raw data, this returned object can be huge.

    Read the article

  • Which type of Rails model association should I use in this situation?

    - by jstayton
    I have two models/tables in my Rails application: discussions and comments. Each discussion has_many comments, and each comment belongs_to a discussion. My discussions table also includes a first_comment_id column and last_comment_id column for convenience and speed. I want to be able to call discussion.last_comment for the last comment model, but the following (in my discussion model) isn't working to make this happen: has_one :first_comment, :class_name => "Comment" has_one :last_comment, :class_name => "Comment" When I call discussion.last_comment, the following SQL is run: SELECT * FROM `comments` WHERE (`comments`.discussion_id = 1) LIMIT 1 It's using the discussions.id column to join against comments.discussion_id, when I want it to join discussions.last_comment_id against comments.id. Am I using the wrong type of association here? Thanks for your help!

    Read the article

  • WPF List of ViewModels bound to list of Model objects.

    - by Eric
    In the model, I have: public ObservableCollection<Item> Items { get; private set; } In the ViewModel, I have a corresponding list of ItemViewModels: public ObservableCollection<ItemViewModel> ItemViewModels ... In the XAML, I will bind (in this case a TreeView) to the ItemViewModels property. My question is, what goes in the "..." in the ViewModel shown above? I am hoping for a line or two of code to binds these two ObservableCollections (providing the type of the ViewModel to construct for each model object). However, what I'm fearing is necessary is a bunch of code to handle the Items.CollectionChanged event and manually updates the ItemViewModels list by constructing ViewModels as necessary. Thanks! Eric

    Read the article

  • Rails multi level model security

    - by rballz
    I have the need to do the following in Rails to mirror a desktop application: a User and an Office 'owns' a record, if you don't own the record on a user or office level you're kicked into the public realm. user gets read,write,delete to the model record office gets read/write/delete to the model record other or public gets read/write/delete to the model record e.g. UserA owns a model record with read/write/delete OfficeA owns a model with read/write other/public gets read I was wondering if a plugin/gem existed to grant this functionality?

    Read the article

  • Why can't I register a custom model binder for a List<int>?

    - by quarksoup
    I have an action that looks like public ActionResult GetUsers(List<int> userIds) {//do stuff} The list of userIds can become quite long, so I want to use Json.Net to deserialize it. To do so I created an IModelBinder implementation, which works fine for other objects, but never gets called for a List. The IModelBind looks like this public class JsonBinder : System.Web.Mvc.IModelBinder { public object BindModel(System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ModelBindingContext bindingContext) { //Do model binding stuff using Json.Net } } And I register this model binder with this line ModelBinders.Binders.Add(typeof(List<int>), new JsonBinder()); However the JsonBinder is never called. Why is this? Should I be using a ValueProvider?

    Read the article

  • Is it valid to include view code in Model?

    - by Shreekumar S
    Guys I'm new to RoR and MVC. I've a model which deals with loan beneficiary's data. To access the structured data (including small piece of HTML data) I created a method like this class Beneficiary < ActiveRecord::Base   def info   "#{name}</br>#{age},#{sex}</br><b>Address :</b>#{address}"   end end And in the view, I'm using this info something like this <%= @b.info.html_safe %> were, b is an instance of Beneficiary class It's working fine for me. I just want to know that, Am i violating the MVC rule here? Is it valid to include view code in Model?

    Read the article

  • Fixing the Model Binding issue of ASP.NET MVC 4 and ASP.NET Web API

    - by imran_ku07
            Introduction:                     Yesterday when I was checking ASP.NET forums, I found an important issue/bug in ASP.NET MVC 4 and ASP.NET Web API. The issue is present in System.Web.PrefixContainer class which is used by both ASP.NET MVC and ASP.NET Web API assembly. The details of this issue is available in this thread. This bug can be a breaking change for you if you upgraded your application to ASP.NET MVC 4 and your application model properties using the convention available in the above thread. So, I have created a package which will fix this issue both in ASP.NET MVC and ASP.NET Web API. In this article, I will show you how to use this package.           Description:                     Create or open an ASP.NET MVC 4 project and install ImranB.ModelBindingFix NuGet package. Then, add this using statement on your global.asax.cs file, using ImranB.ModelBindingFix;                     Then, just add this line in Application_Start method,   Fixer.FixModelBindingIssue(); // For fixing only in MVC call this //Fixer.FixMvcModelBindingIssue(); // For fixing only in Web API call this //Fixer.FixWebApiModelBindingIssue(); .                     This line will fix the model binding issue. If you are using Html.Action or Html.RenderAction then you should use Html.FixedAction or Html.FixedRenderAction instead to avoid this bug(make sure to reference ImranB.ModelBindingFix.SystemWebMvc namespace). If you are using FormDataCollection.ReadAs extension method then you should use FormDataCollection.FixedReadAs instead to avoid this bug(make sure to reference ImranB.ModelBindingFix.SystemWebHttp namespace). The source code of this package is available at github.          Summary:                     There is a small but important issue/bug in ASP.NET MVC 4. In this article, I showed you how to fix this issue/bug by using a package. Hopefully you will enjoy this article too.

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >